Reputation: 408
I want to get the Ratio of count1 / count2
which gives me percent compliant.
this is right beneath my finger tips...
Can I get some help?
Select
(
Select Count (*) from tso_skf_nomeas_in60days_v
) as count1,
(
Select Count (*) from tso_skf_recent_meas
) as count2
(
from dual
Upvotes: 4
Views: 8140
Reputation: 408
Updated Answer:
Select Count1/Count2
FROM (Select Count(*) Count1 From tso_skf_nomeas_in60days_v) tso_skf_nomeas_in60days_v,
(Select Count(*) Count2 From tso_skf_recent_meas) tso_skf_recent_meas;
as see on SQL Fiddle.
Final Results:
Upvotes: 1
Reputation: 1457
SELECT
(SELECT cast(COUNT(*) as float) FROM tso_skf_nomeas_in60days_v)
/
(SELECT cast(COUNT(*) as float) FROM tso_skf_recent_meas) as perc
FROM dual
Upvotes: 2
Reputation: 62841
You're pretty close:
Select
(Select Count (*) from tso_skf_nomeas_in60days_v)
/
(Select Count (*) from tso_skf_recent_meas) as perc
from dual
Upvotes: 6