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;
Run Code Online (Sandbox Code Playgroud)
我想恢复名为列的结果c,但如您所见,这是语法错误...
有没有办法做到这一点?
使用 information_schema:
SELECT
table_name AS c
FROM
information_schema.tables
WHERE
table_schema = DATABASE()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3816 次 |
| 最近记录: |