使用SQL語句模糊查詢資料庫中的表名

2021-09-28 17:45:41 字數 516 閱讀 5558

資料庫中表很多的時候,想找一張表,只記得表中文名稱,不記得英文表名,可以用下邊的語句模糊查詢

select table_name 表名, table_comment '表註解' from information_schema.tables where table_schema = 'merchant_service' and table_comment like '%終端%';
information_schema是mysql自帶的,它提供了訪問資料庫的資訊。其中儲存著關於mysql伺服器所維護的所有其他資料庫的資訊。如資料庫名,資料庫的表,表屬於哪個schema,表型別,表引擎,建立時間,表欄的資料型別與訪問許可權等資訊。

table_schema = '資料庫名'

%表名%

sqlserver資料庫模糊查詢語句

確切匹配 select from hs user where id 123 模糊查詢 select from hs user where id like 123 為萬用字元 萬用字元 like用於字串,如果要對數字進行操作用in.in 200,230 萬用字元描述示例 包含零個或更多字元的任意字串。...

資料庫SQL語句查詢

新手小白菜一枚,求知 查詢所有同學的學號 姓名 選課數 總成績 select t1.stuid,t1.stuname,count t2.courseid sum score from tblstudent t1,tblscore t2 where t1.stuid t2.stuid group by...

SQL模糊查詢語句

sql模糊查詢的語法為 select column from table where column like pattern sql提供了四種匹配模式 1.表示任意0個或多個字元。如下語句 select from user where name like 三 將會把name為 張三 三腳貓 唐三藏 ...