1
如何將這兩個查詢合併爲一個?將2個查詢合併爲1兩個查詢都有不同的表格和求和
select
count(case when sd_code in (select sd_code from sdrp15_submission_log
where QA_date is null) then 1 end) as Changes,
count(case when sd_code in (select sd_code from sdrp15_submission_log
where QA_date is not null) then 1 end) as Complete
from sdrp15_cosd
給我的結果
CHANGES COMPLETE
---------- ----------
629 210
和
select a.phase,a.st_code||' - '||b.state_name,
case when a.submission_received_dt is not null then 'Y' else 'N' end as Changes
from pcspro.sdrp15_return a,
pcspro.sdrp15_states_ready b
where a.phase = b.phase and a.st_code = b.state;
給我的結果
PHASE A.ST_CODE||'-'||B.STATE_NAME CHANGES
----- ----------------------------------- -------
A 01 - Alabama (AL) Y
A 01 - Alabama (AL) Y
A 16 - Idaho (ID) Y
A 30 - Montana (MT) Y
A 56 - Wyoming (WY) Y
,並有可能創建一個行that''ll出現最後,總數變化和補充TE?
能否請你澄清你在找什麼在你的第二個問題嗎? – FutbolFan