Oracle 5種模糊查詢資料庫中的表的方法

2021-09-12 14:01:55 字數 635 閱讀 2063

有時候,我們會忘記某張表的名字,這時需要在資料庫中模糊查詢某張表;

我們需要在某張表中查詢其他所有的表,這張表應該統計資料庫中所有其他的表;可以有兩張錶可供查詢:

all_tables

user_objects;

user_tab_comments;

dba_tab_columns;

user_tables;

基本語法:

select * from all_tables  a where a.table_name like '%demo%';

select * from user_objects a where a.object_name like '%demo%';

select * from user_tab_comments a where a.table_name like '%demo%'

or a.comments like '%樣例%';

select * from all_tables a where a.table_name like '%demo%';

select *

from user_tablesa where a.table_name like '%demo%';

資料庫模糊查詢4種用法

1,表示任意0個或多個字元。可匹配任意型別和長度的字元,有些情況下若是中文,請使用兩個百分號 表示。比如 select from user where u name like 三 將會把u name為 張三 張貓三 三腳貓 唐三藏 等等有 三 的記錄全找出來。另外,如果需要找出u name中既有 三...

資料庫模糊查詢

執行資料庫查詢時,有完整查詢和模糊查詢之分。一般模糊語句格式如下 select 字段 from 表 where 某欄位 like 條件 其中,關於條件,sql提供了四種匹配模式 可以匹配任意型別和任意長度的字元,有些情況下若是中文,請使用兩個百分號 表示。select from flow user ...

資料庫模糊查詢

一 模糊查詢 運算子語法描述 is null a is null 如果操作符為null,則結果為真 is not null a is not null 如果操作符不為null,則結果為真 between a between b and c 若a在b和c之間,則結果為真 like a like b 如...