01.
select
02.
a.all_data ad, a.act_data aa, (a.act_data / a.all_data* 100)
as
a_percent
03.
b.all_data bd, b.act_data ba, (b.act_data / b.all_data* 100)
as
b_percent
04.
from
(
05.
select
count
(id) all_data, (
select
count
(detail) form tb_detail
where
a......)
as
act_data
from
tb_primary
where
a....
06.
)
as
a,
07.
(
08.
select
count
(id) all_data, (
select
count
(detail) form tb_detail
where
b.....)
as
act_data
from
tb_primary
where
b...
09.
)
as
b