1、with ...as ..
with temp as (select * from table1 where 1=1)
select * from temp
2、union 和 union all
Union:對兩個結果集進行並集操作,不包括重複行,同時進行默認規則的排序;
Union All:對兩個結果集進行並集操作,包括重複行,不進行排序;
3、NVL2函數
NVL2(E1, E2, E3)的功能爲:如果E1爲NULL,則函數返回E3,若E1不爲null,則返回E2。
4、decode
使用結構:
decode(條件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值)