-3
Select GroupId,count(distinct GroupProgramYearParticipantID)as [ChildAddedcurrent]
from #temp1
Where (MonthFlag = 0) and (ParticipantTypeName = 'child')
and (GroupProgramYearParticipantID not in
(Select distinct GroupProgramYearParticipantID
from #temp1
Where (MonthFlag = 1) and (ParticipantTypeName = 'child')))
group by groupId
內選擇查詢檢查,以檢查在所有GROUPID在表中,但我希望它在在外部選擇中引用的每個對應的組檢查查詢。內子查詢需要在同一組,但不是在所有組
你的問題到底是什麼? – dcaswell
如果你不能正確地解釋你的問題,我們不會費心去嘗試和幫助。 –
對不起。內部選擇查詢檢查所有組中的記錄,但需要檢入相應的組。 – Aditya