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

MySQLMySQLi Database

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.

Published on 22-Feb-2018 06:08:06