我已经做了一个复杂的查询来获取多个值。然后显示第二个参数占总数的百分比。
我必须对大量变量执行此操作。
基本上:
我必须对大约6个参数执行此操作。
select
sum(givesmeonesubset_1) as grandtotal
(
Select
count(*) as givesmeonesubset_1
from
table1
union all
Select
count(*) as givesmeonesubset_2
from
table2
)
union all
select
sum(givesmeonesubset_param) as subtotalparam
(
Select
count(*) as
from
table1
where param ='x'
union all
Select
count(*) as givesmeonesubset_2
from
table2
where param ='x'
)