输入banner图图片脚本导航/分类

SQL技巧之分类汇总

a as( select type,sum(num) as num from foods group by type), b as( select type,(case when type=‘小麦‘ then 1.2 when type=‘玉米‘ then 1.5 end)*num as price from a) select sum(price) as result from b

 

SQL技巧之分类汇总

标签: