oracle group 语法
简单
select 类别, sum(数量) as 数量之和
from A
group by 类别
加上排序
select 类别, sum(数量) AS 数量之和
from A
group by 类别
order by sum(数量) desc
(类别+ 摘要)
select 类别, 摘要, sum(数量) AS 数量之和
from A
group by 类别, 摘要
having 统计条件筛选
select 类别, sum(数量) as 数量之和 from A
group by 类别
having sum(数量) > 18
compute 计算属性
compute子句能够观察“查询结果”的数据细节或统计各列数据(如例10中max、min和avg)
select *
from A
where 数量>8
compute max(数量),min(数量),avg(数量)
select *
from A
where 数量>8
order by 类别
compute max(数量