select length('ABCD') from dual;
select substr('ABCD',2,2) from dual;
select concat('ABC','D') from dual;
select 'ABC'||'D' from dual;
select round(100.567) from dual
select round(100.567,2) from dual
select trunc(100.567) from dual
select trunc(100.567,2) from dual
select mod(10,3) from dual
select sysdate from dual
select add_months(sysdate,2) from dual
select last_day(sysdate) from dual
select TRUNC(sysdate) from dual
select TRUNC(sysdate,'yyyy') from dual
select TRUNC(sysdate,'mm') from dual
select TO_CHAR(1024) from dual
select TO_CHAR(sysdate,'yyyy-mm-dd') from dual
select TO_CHAR(sysdate,'yyyy-mm-dd hh:mi:ss') from dual
select TO_DATE('2017-01-01','yyyy-mm-dd') from dual
select to_number('100') from dual
select NVL(NULL,0) from dual
select PRICE,MINNUM,NVL(MAXNUM,9999999)
from T_PRICETABLE where OWNERTYPEID=1
select PRICE,MINNUM,NVL2(MAXNUM,to_char(MAXNUM) , '不限')
from T_PRICETABLE where OWNERTYPEID=1
decode(条件,值 1,翻译值 1,值 2,翻译值 2,...值 n,翻译值 n,缺省值)
select name,decode( ownertypeid,1,' 居 民 ',2,' 行 政 事 业 单 位
',3,'商业') as 类型
from T_OWNERS
select name ,(case ownertypeid
when 1 then '居民'
when 2 then '行政事业单位'
when 3 then '商业'
else '其它'
end
) from T_OWNERS
select name,(case
when ownertypeid= 1 then '居民'
when ownertypeid= 2 then '行政事业'
when ownertypeid= 3 then '商业'
end )
from T_OWNERS
select rank() over(order by usenum desc ),usenum from
T_ACCOUNT
select dense_rank() over(order by usenum desc ),usenum
from T_ACCOUNT
select row_number() over(order by usenum desc ),usenum
from T_ACCOUNT
select * from
(select row_number() over(order by usenum desc )
rownumber,usenum from T_ACCOUNT)
where rownumber>10 and rownumber<=20
select * from t_owners where id<=7
union all
select * from t_owners where id>=5
select * from t_owners where id<=7
union
select * from t_owners where id>=5
select * from t_owners where id<=7
intersect
select * from t_owners where id>=5
select * from t_owners where id<=7
minus
select * from t_owners where id>=5
select rownum,t.* from T_ACCOUNT t where rownum<=20
minus
select rownum,t.* from T_ACCOUNT t where rownum<=10
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |