I've had a look and reviewed the MySQL syntax, but can't figure out the right query modifier.
当您执行普通的选择查询时,如果有很多列(或一个或两个宽列),则输出会在屏幕上缠绕,使其难以阅读。
+----------------------------------------+-----------+--------+-----------------------
-----------------+----------------------------------------+------+-------------------+
--------------+---------------------------+-----------------+-------------------+-----
-------------------+-----------------+-------------------+-----------+
我记得有人向我展示很长一段时间有一种方法可以强制MySQL在自己的行上输出每一列,如下所示:
id: 123456
Short_Field: Boy it's short
A_Long_Field: This is quite long, wow, very lorum, much ipsum...
任何人都可以告诉我在跟随查询中需要放入什么来复制此行为:
SELECT * FROM TABLE WHERE COLUMN="value" LIMIT 1;
答案 0 :(得分:4)
您正在寻找的模式称为“垂直输出”,当使用\G
作为MySQL命令行客户端中的分隔符时,它可用。
SELECT * FROM `table` WHERE `column` = 'value' LIMIT 1\G