How can MySQL produce the output in a vertical format rather than tabular format?


By using \G at the end of MySQL statement, it returns the output in a vertical format rather than a tabular format. Consider the example below −

mysql> Select curdate();
+------------+
| curdate()  |
+------------+
| 2017-11-06 |
+------------+
1 row in set (0.00 sec)

mysql> Select CURDATE()\G
*************************** 1. row ***************************
CURDATE(): 2017-11-06
1 row in set (0.00 sec)

From the example above, the difference of using \G at the end of the MySQL statement can be understood. It returns the same output in a vertical format rather than a tabular format.

Updated on: 22-Jun-2020

338 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements