MYSQL: Use the \ G parameter to change the display mode of the output result set.

Source: Internet
Author: User


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 common SQL command output is as follows: www.2cto.com [SQL] mysql> select * from t_goods; + ------ + ------------ + ---------- + ------------ + response + | id | goods_name | quantity | add_date | description | + ------ + ------------ + ---------- + response + | 1 | MYSQL5 | 50 | 2012-12-12 | A book that has been rea D but is I n good condition. see the seller's listing for full details and descr iption of any imperfections. | + ------ + ------------ + ---------- + ------------ + ----------------------------------------------------------- + The following is the output using the \ G option: [SQL] mysql> select * from t_goods \ G **************************** 1. row ************************* id: 1 goods_name: MYSQL5 quantity: 50 add_date: 2012-12-12 des Cription: 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: \ G is an upper-case letter and cannot be lower-case. After the \ G parameter is used, the SQL statement can not be followed by a separator. If a separator is added, an "error: no query specified "error. The Display Effect of www.2cto.com is the same as that of 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.

Related Article

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.