select
1 AS FZ
${if(主体='city',",city",",NULL AS city")}
${if(主体='store',",store",",NULL AS store")}
${if(主体='product',",product",",NULL AS product")}
,SUM(price*sales) AS JE
from sale
GROUP BY
1
${if(主体='city',",city","")}
${if(主体='store',",store","")}
${if(主体='product',",product","")}
--------------------------------------------------------------------------------------------------
问.rar