当前位置:网站首页>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
\gAnd 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
边栏推荐
- Range of numbers (dichotomous classic template topic)
- Cmake basic tutorial (39) pkgconfig
- 第36期《AtCoder Beginner Contest 248 打比赛总结》
- Pavlov and hobbies
- The address value indicated by the pointer and the value of the object indicated by the pointer (learning notes)
- Add two pointers? (legal or illegal)
- On the use of constant pointer and pointer constant -- exercise (record)
- Differences between auto and decltype inference methods (learning notes)
- Golang通过exec模块实现Ping连通性检测案例
- The main difference between pointer and reference
猜你喜欢

uni使用的一些坑

open3d材质设置参数分析

Breadth first search topics (BFS)

QT drawpixmap and DrawImage blur problem

Various situations of data / component binding

On the use of constant pointer and pointer constant -- exercise (record)

Flutter 新一代圖形渲染器 Impeller

‘EddiesObservations‘ object has no attribute ‘filled‘

STL learning notes 0x0001 (container classification)

deep learning object detection
随机推荐
Issue 36 summary of atcoder beginer contest 248
Hongji cyclone RPA provides technical support for Guojin securities and realizes process automation in more than 200 business scenarios
js数字大写方法
可执行程序执行流程
基于ssm 包包商城系统
The QT debug version runs normally and the release version runs crash
Golang通过exec模块实现Ping连通性检测案例
Common protocols of OSI layer
World and personal development
50 SQL exercises, answers and detailed analysis
Edit, cancel, pull up menu
What financial products will benefit during May Day?
第36期《AtCoder Beginner Contest 248 打比赛总结》
open3d材质设置参数分析
Write the declaration of a function to return the reference of the array, and the array contains 10 string objects (notes)
Hongji micro classroom | cyclone RPA's "flexible digital employee" actuator
ES6之解构函数
Jiugong magic square - the 8th Lanqiao provincial competition - group C (DFS and comparison of all magic square types)
what is wifi6?
Markdown syntax support test