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

 

posted @ 2023-10-31 10:09  每天进步多一点  阅读(292)  评论(0)    收藏  举报