標籤:acl 資料庫匯出 appear 條件 dao 包含 串連符 split 函數返回
1.NVL函數,用法:nvl(a,b)當第一個參數為空白時,則顯示第二個參數
2.遞迴查詢:connect by:一般用法:start with...connect by ...
例:select * from emp connect by mgr =prior empno start with empno=7839
表示從empno為7839開始向上遞迴查詢,上一條記錄的empno=本條記錄的mgr,prior表示上一條記錄(父記錄)
注意:connect by mgr =prior empno和connect by prior mgr = empno遞迴的方向相反
3.select 1 from table...表示查看錶是否有資料
4.select column_value A from table :查詢偽列,即將查詢出的資料作為A列(自己指定)
5.exits:表示內子查詢結果不為空白,則where條件成立
6.查看數控庫版本:select * from v$version
7.in和exits的區別
例:select * from B where cc in (select cc from A);
這是先查詢出A表中的cc再與B表中的匹配,用於A表遠小於B表時
select * from B exits(select cc from A where cc=b.cc)
這是先查出B表中的cc再與A表匹配
8.splitstr函數:將字串按指定字元進行分割
如:select * from table(splitstr(‘1,2,3,4‘,‘,‘))
9.union:合并兩個或多個查詢的結果集,預設不包含重複值,如果想保護重複值,則使用unionall
10.dual:常用於沒有目標表的查詢中
11.instr函數返回要截取的字串在源字串中的位置,
例:instr(String1,String2,start_position,nth_appearanece)分別表示:String1源字串,String2要在源字串中尋找的字串,開始尋找的位置,尋找第幾次出現的string2
12.||在oracle中表示字串串連符
13.Oracle資料庫匯出命令 exp name/[email protected]:1521/orcl file=F:\daochu.dmp full=y
Oracle知識點整理