select a1=isnull(a1,'合计'),a2,count(*)
from table
group by a1,a2 with rollup 执行上面语句,最后一行有"合计",而执行下面语句,却没有"合计":select a1=isnull(a1+'-'+a2),'合计'),count(*)
from table
group by isnull(a1+'-'+a2),'合计') with rollup 请问第2条语句该怎样写?
from table
group by a1,a2 with rollup 执行上面语句,最后一行有"合计",而执行下面语句,却没有"合计":select a1=isnull(a1+'-'+a2),'合计'),count(*)
from table
group by isnull(a1+'-'+a2),'合计') with rollup 请问第2条语句该怎样写?
from table
group by (a1+'-'+a2) with rollup
from (
select a1+'-'+a2 as x
from table
) as t
group by x with rollup