decode(條件,值1,翻譯值1,值2,翻譯值2,...值n,翻譯值n,預設值) 該函數的含義如下:IF 條件=值1 THEN RETURN(翻譯值1)ELSIF 條件=值2 THEN RETURN(翻譯值2) ......ELSIF 條件=值n THEN RETURN(翻譯值n)ELSE RETURN(預設值)END IF 使用方法: 1、比較大小select decode(sign(變數1-變數2),-1,變數1,變數2)
要練好基本工,我不想工作的時候寫個簡單的查詢語句再翻課本喲.create table test(Name varchar2(16),Age number(3),Birth date)select * from testselect * from empselect ename,sal,sal*12 + 100 from empselect ename ||' work at ' || job from empselect ename||null||job from empselect comm*
有如下代碼:declare -- query emp.name cursor cur_emp is select empno, ename, job from emp where empno = 7369 for update of ename;begin for return_cur in cur_emp loop update emp set ename = 'LHG'
原文鏈接:http://specialwolf.blog.163.com/blog/static/124466832201131844717382/此處是將scott用戶下面的數據導出再導入到test用戶下:C:\Documents and Settings\dean_deng>exp system/manager@orcl file=E:\test.dmp owner=(scott)Export: Release 10.1.0.2.0 - Production on 星期四 5月 3 1
create table products( productid number(10) not null, name varchar2(255), description CLOB);查詢語句:select t.productid, t.name from products t where dbms_lob.instr(t.description, 'aaa', 1, 1) >
錯誤資訊:WIN的事件檢視器:An error occured while trying to initialize the service.手工啟動:emctl start dbconsoleEnvironment variable ORACLE_SID not defined. Please define it.當執行set OARCLE_SID=orcl,繼續報錯Unable to determine local host from URL
1.查詢系統使用的是哪一組記錄檔:select * from v$log;2.查詢正在使用的組所對應的記錄檔:select * from v$logfile;3.強制日誌切換:alter system switch logfile;4.查詢曆史日誌:select * from v$log_history;5.查詢日誌的歸檔模式:select dbid,name,created,log_mode from v$database;6.查詢歸檔日誌的資訊:select