[英]How to do “show tables as col” alike stuff?
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| t |
| t2 |
| test |
+----------------+
3 rows in set (0.00 sec)
mysql> show tables as c;
ERROR 1064 (42000): You have an error in your SQL syntax;
我想在名為c
列中恢復結果,但是如您所見,這是語法錯誤...
有沒有辦法做到這一點?
使用information_schema:
SELECT
table_name AS c
FROM
information_schema.tables
WHERE
table_schema = DATABASE()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.