![](/img/trans.png)
[英]How can I get a list of all tables and views used in the from clause of tables and views in a MYSQL Database?
[英]How can I get a list of all tables in database with selected prefix?
與主題標題相同。 我的數據庫包含大量輔助表。 想要構建一個下拉列表以選擇我要從中加載內容的表。 此代碼...不起作用:
SELECT table_name FROM sys.tables WHERE table_name LIKE 'Mytable_%'
在mysql中,您可以訪問information_schema過濾數據庫名稱
SELECT table_name
FROM INFORMATION_SCHEMA.TABLES
WHERE table_schema = 'your_db_name'
and table_name LIKE 'Mytable_%'
and table_type = 'BASE TABLE';
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.