MYSQL: use the/G parameter to change the display mode of the output result set _ MySQL

Source: Internet
Author: User
MYSQL: use the G parameter to change the display mode of the output result set bitsCN.com


MYSQL: use the/G parameter to change the display mode of the output result set.

Use the/G parameter in the MYSQL command line to display the output by column. It is useful when you need to view the values of each field in the table.

The output of common SQL commands is as follows:

[SQL]

Mysql> select * from t_goods;

+ ------ + ------------ + ---------- + ------------ + -----------------------------------

----------------------------- +

| Id | goods_name | quantity | add_date | description

|

+ ------ + ------------ + ---------- + ------------ + -----------------------------------

----------------------------- +

| 1 | MYSQL5 | 50 | 2012-12-12 | A book that has been read but is I

N good condition. See the seller's listing for full details and descr iption

Any imperfections. |

+ ------ + ------------ + ---------- + ------------ + -----------------------------------

----------------------------- +

The output using the/G option is as follows:

[SQL]

Mysql> select * from t_goods/G

* *************************** 1. row ***************************

Id: 1

Goods_name: MYSQL5

Quantity: 50

Add_date: 2012-12-12

Description: A book that has been read but is in good condition. See t

He seller's listing for full details and description of any imperfections.

Note: The/G is an upper-case letter and cannot be lower-case. after the/G parameter is used, the SQL statement does not have a separator. if a separator is added, an error is returned: no query specified "error.

This display effect is the same as the-E parameter of the MYSQL command. After the-E parameter is used, the result set is displayed as a column by default:

[SQL]

C:/Users/qxl> mysql-uroot-E

Welcome to the MySQL monitor. Commands end with; or/g.

Your MySQL connection id is 13

Server version: 5.1.28-rc-community MySQL Community Server (GPL)

Type 'help; 'or'/h' for help. type'/C' to clear the buffer.

Mysql> use test;

Database changed

Mysql> select * from t_goods;

* *************************** 1. row ***************************

Id: 1

Goods_name: MYSQL5

Quantity: 50

Add_date: 2012-12-12

Description: A book that has been read but is in good condition. See t

He seller's listing for full details and description of any imperfections.

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.