常用的语法: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() 行转列。。。
编不出来了 ,下次再来