常用的語法:select--from--where--group by--having--order by 1、分組子句group by +con 按什麼分組 2、having子句 對上面分組的數據進行再次條件過濾 3、排序子句 order by order by + con ASC 升序 orde ...
常用的語法:select--from--where--group by--having--order by
1、分組子句group by +con 按什麼分組
2、having子句 對上面分組的數據進行再次條件過濾
3、排序子句 order by
order by + con ASC 升序 order by + con desc j降序
select con1 ,con2 from ......+ order by 1 按con1排序/+ order by 2 按con2排序
當一個查詢語句同時出現了where,group by,having,order by的時候,執行順序和編寫順序是:
from -> where ->group by ->having ->select ->order by
常用函數:
1、統計類函數 count() sum() avg()
2、分析函數
OVER(PARTITION BY xxx PORDER BY yyy ROWS )
3、other: nvl() 、listagg() 行轉列。。。
編不出來了 ,下次再來