当前位置:网站首页>MySQL query uses \ g, column to row
MySQL query uses \ g, column to row
2022-04-23 05:39:00 【GroupiesM】
Mysql At the end of the query, you can use \G
、\g
、;
To specify the query format ,( Only in command line mode , use navicat、dbeaver And other connection tools do not support )
- Query usage
\G
, Result column to row
mysql> select * from emp limit 2\G
*************************** 1. row ***************************
empno: 7369
ename: SMITH
job: CLERK
mgr: 7902
hiredate: 1980-12-17
sal: 800.00
comm: NULL
deptno: 20
*************************** 2. row ***************************
empno: 7499
ename: ALLEN
job: SALESMAN
mgr: 7698
hiredate: 1981-02-20
sal: 1600.00
comm: 300.00
deptno: 30
2 rows in set (0.00 sec)
- Query usage
\g
And use;
The effect is the same
mysql> select * from emp limit 2\g
+-------+-------+----------+------+------------+---------+--------+--------+
| empno | ename | job | mgr | hiredate | sal | comm | deptno |
+-------+-------+----------+------+------------+---------+--------+--------+
| 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | NULL | 20 |
| 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 |
+-------+-------+----------+------+------------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select * from emp limit 2;
+-------+-------+----------+------+------------+---------+--------+--------+
| empno | ename | job | mgr | hiredate | sal | comm | deptno |
+-------+-------+----------+------+------------+---------+--------+--------+
| 7369 | SMITH | CLERK | 7902 | 1980-12-17 | 800.00 | NULL | 20 |
| 7499 | ALLEN | SALESMAN | 7698 | 1981-02-20 | 1600.00 | 300.00 | 30 |
+-------+-------+----------+------+------------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql>
版权声明
本文为[GroupiesM]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230534405928.html
边栏推荐
- Map对象 map.get(key)
- Intel SGX preliminary learning and understanding notes (continuously updated)
- Redis经典面试题总结2022
- Flutter 新一代圖形渲染器 Impeller
- [triangle Yang Hui triangle printing odd even cycle JS for break cycle]
- Batch import of orange single micro service
- Some pits used by uni
- QSS, qdateedit, qcalendarwidget custom settings
- Step on the pit: Nacos uses startup CMD - M standalone startup error
- CMake基础教程(39)pkgconfig
猜你喜欢
Flutter nouvelle génération de rendu graphique Impeller
After adding qmenu to qtoolbutton and QPushButton, remove the triangle icon in the lower right corner
QT drawpixmap and DrawImage blur problem
[triangle Yang Hui triangle printing odd even cycle JS for break cycle]
橙单微服务之批量导入
Differences between sea level anatomy and sea surface height anatomy
Data mining -- understanding data
Create a tabbar component under the components folder, which is public
Camera imaging + homography transformation + camera calibration + stereo correction
Batch import of orange single micro service
随机推荐
Batch import of orange single micro service
Transposed convolution
STL function library
Common protocols of OSI layer
STL learning notes 0x0001 (container classification)
Relative reference and absolute reference of Excel
巴普洛夫与兴趣爱好
C语言——恶搞关机小程序
xxl-job采坑指南xxl-rpc remoting error(connect timed out)
Rog attack
Call the interface to get the time
Range of numbers (dichotomous classic template topic)
热键,界面可视化配置(界面交互)
World and personal development
Sword finger offer II 022 The entry node of the link in the linked list
Quick app bottom navigation bar
Data mining -- understanding data
Mysql 查询使用\G,列转行
Golang通过exec模块实现Ping连通性检测案例
AcWing 836. Merge set (merge set)