我在我的數據庫中的表,並想通過名稱來選擇指定的表:mysql |與指定的名稱顯示錶
abc_dshop_cats
abc_eshop_cats
abc_shop_cats
abc_shop_mods
abc_shopp_cats
我怎樣才能得到這些表:abc_shop_cats,並使用下面的命令abc_shop_mods:
SHOW TABLES LIKE '%店%' 和上面的命令未正常工作回到我的所有表...
謝謝!
我在我的數據庫中的表,並想通過名稱來選擇指定的表:mysql |與指定的名稱顯示錶
abc_dshop_cats
abc_eshop_cats
abc_shop_cats
abc_shop_mods
abc_shopp_cats
我怎樣才能得到這些表:abc_shop_cats,並使用下面的命令abc_shop_mods:
SHOW TABLES LIKE '%店%' 和上面的命令未正常工作回到我的所有表...
謝謝!
select table_name
from information_schema.tables
where table_name like '%shop%'
你可以做這樣的:
show tables like '%\_shop\_%'
這將讓
abc_shop_cats
abc_shop_mods
但不
abc_dshop_cats
abc_eshop_cats
abc_shopp_cats
只是使用普通的SQL WHERE語句來做到這一點。
SHOW TABLES WHERE Tables_in_mydbname LIKE '%_shop_%'
您需要說明的權利?使用'desc' –
Deep
表名和下一個SHOW CREATE TABLE ...命令 – user889349