sql server Compute、Compute by

发布时间 2023-10-31 10:14:28作者: 每天进步多一点

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 类别