sql server Compute、Compute by
1、原始表
2、Compute 和 Compute By
select * from A where 数量>8 compute max(数量),min(数量),avg(数量)
执行结果如下:
select * from A where 数量>8 order by 类别 compute max(数量),min(数量),avg(数量) by 类别
select * from A where 数量>8 compute max(数量),min(数量),avg(数量)
执行结果如下:
select * from A where 数量>8 order by 类别 compute max(数量),min(数量),avg(数量) by 类别