Mysql查询结尾可使用\G 、\g 、; 来指定查询格式,(仅限于命令行模式下,用navicat、dbeaver等连接工具不支持)
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)
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>
|