
要应用 SELECT 语句猎取表名称,请利用“information_schema.tables”。让咱们望一个例子,个中咱们有一个蕴含 3 个表的数据库。还助 SELECT 语句猎取一切表名称的语法。
SELECT Table_name as TablesName from information_schema.tables where table_schema = 'yourDatabaseName';
登录后复造
利用数据库“test”,并运用上述语法利用 SELECT 猎取表名
mysql> use test; Database changed mysql> SELECT Table_name as TablesName from information_schema.tables where table_schema = 'test';
登录后复造
输入三个表的名称。
+--------------------+ | TablesName | +--------------------+ | destination | | myisamtoinnodbdemo | | originaltable | +--------------------+ 3 rows in set (0.00 sec)
登录后复造
以上等于正在 MySQL 外利用 SELECT 语句猎取表名?的具体形式,更多请存眷萤水红IT仄台此外相闭文章!

发表评论 取消回复