select
100 * different / total
from
(select
count(*) as different
from
a, b
where
........) t1,
(select
count(*) as total
from
a
where
.......) t2
select
100 * different / total
from
(select
count(*) as different
from
a, b
where
........) t1,
(select
count(*) as total
from
a
where
.......) t2