\G 的作用是将查到的结构变成纵向
不加\G的前效果,加上显示屏太少:
mysql> select * from tb_users;
+----+-------------------------------------------------------------------------------+------------+--------------+----------+------------+-----------+--------------+----------+-----------+----------------------------+-------------+
| id | password | last_login | is_superuser | username | first_name | last_name | email | is_staff | is_active | date_joined | mobile |
+----+-------------------------------------------------------------------------------+------------+--------------+----------+------------+-----------+--------------+----------+-----------+----------------------------+-------------+
| 1 | pbkdf2_sha256$36000$m2YDpMWTjQqD$VMon3lKK00fTfplkSlJYMAehcBzc/T5iDAfOqIpQrow= | NULL | 1 | admin | | | admin@qq.com | 1 | 1 | 2018-07-02 13:31:37.278366 | |
| 2 | pbkdf2_sha256$36000$XJrhIQ0buCcc$+PPjUCfJc1t2fQ+g5HUtvT0WTPNcYj9+yNQ+GSPBwx8= | NULL | 0 | python | | | | 0 | 1 | 2018-07-05 12:33:10.658602 | 13155667788 |
+----+-------------------------------------------------------------------------------+------------+--------------+----------+------------+-----------+--------------+----------+-----------+----------------------------+-------------+
2 rows in set (0.00 sec)
加\G的前效果,简洁。
mysql> select * from tb_users \G;
*************************** 1. row ***************************
id: 1
password: pbkdf2_sha256$36000$m2YDpMWTjQqD$VMon3lKK00fTfplkSlJYMAehcBzc/T5iDAfOqIpQrow= last_login: NULL
is_superuser: 1
username: admin
first_name:
last_name:
email: admin@qq.com
is_staff: 1
is_active: 1
date_joined: 2018-07-02 13:31:37.278366
mobile:
*************************** 2. row ***************************
id: 2
password: pbkdf2_sha256$36000$XJrhIQ0buCcc$+PPjUCfJc1t2fQ+g5HUtvT0WTPNcYj9+yNQ+GSPBwx8=
last_login: NULL
is_superuser: 0
username: python
first_name:
last_name:
email:
is_staff: 0
is_active: 1
date_joined: 2018-07-05 12:33:10.658602
mobile: 13155667788
2 rows in set (0.00 sec)
注:例子里的信息都事测试使用的,不是真实数据
网友评论