摘要:
SQL> select * from a1; ID NAME---------- ---------- 1 a 1 a 2 a 3 aSQL> select * from a2; ID---------- 2 3 2SQL> select * from a1 where id not... 阅读全文
摘要:
---取1到3位SQL> select job,substr(job,1,3) from emp;JOB SUBSTR--------- ------CLERK CLESALESMAN SALSALESMAN SALMANAGER MANSALESMAN SALMANAGER ... 阅读全文
摘要:
select * from dt where dw_data=to_date(to_char(sysdate-1,'YYYY-MM-DD'),'YYYY-MM-DD') ---取前一天日期SQL> select * from dt where dw_data=trunc(sysdate-1,'d... 阅读全文
摘要:
SQL> select data,translate(data,'0123456789','##########') as num1, replace(translate(data,'0123456789','##########'),'#','') as num2 from v;DATA ... 阅读全文
摘要:
SQL> select comm,nvl(comm,0)from emp; COMM NVL(COMM,0)---------- ----------- 0 300 300 500 500 0 1400 1400 ... 阅读全文
摘要:
SQL> select * from (select ename,job from emp order by dbms_random.value() ) where rownum /ENAME JOB---------- ---------TURNER SALESMANCLARK ... 阅读全文
摘要:
SQL> select ename,sal, case when sal = 4000 then 'OVERPAID' else 'OK' end as sal from emp; 2 3 4 ... 阅读全文
摘要:
使用||作为连接运算符SQL> select ename||CHR(32)||CHR(32)||'WORK AS A '||job as msg from emp;MSG-------------------------------SMITH WORK AS A CLERKALLEN WORK ... 阅读全文