我想获得count1 / count2
的比率,
这使我符合百分比。这就在我的指尖下方……
我能得到一些帮助吗?
Select
(
Select Count (*) from tso_skf_nomeas_in60days_v
) as count1,
(
Select Count (*) from tso_skf_recent_meas
) as count2
(
from dual
你非常接近:
Select
(Select Count (*) from tso_skf_nomeas_in60days_v)
/
(Select Count (*) from tso_skf_recent_meas) as perc
from dual
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
更新答案:
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;
最终结果: