我似乎無法掌握滿足此問題需求的sql。 到目前爲止,我有:如何在SQL中使用異或類似功能
select * from customformresponses
INNER JOIN exhibitors ON
Exhibitors.ExhibitorId= customformresponses.ExhibitorId
WHERE customformresponses.exhibitorid='8179cde9-b922-430a-9024-bd4cb8b3d05c'
and exhibitors.exhibitionID = 'e641a3d4-cb57-4f67-86a1-5c2f4c3cf6e0'
and customformresponses.FormID = 'c7f5f0de-35f8-412d-9c91-eaf8bb1a3c26'
我需要在3個不同的formID值來搜索反應,但遇到的問題IM是,如果我有:
customformresponses.FormID = 'c7f5f0de-35f8-412d-9c91-eaf8bb1a3c26' or
customformresponses.FormID = 'c7f5f0de-35f8-412d-9c91-eaf8bb1a3c26' or
customformresponses.FormID = 'e69cee39-2519-434d-be3e-516ba156b444'
然後它只返回的第一個結果真正的條件不是任何真實的條件。
如何返回符合此條件的行的所有結果?
XOR是什麼意思,你的意思是參展商必須只與其中一個條件相符?注意:OR的前兩部分是相同的。 – RichardTheKiwi 2011-01-31 03:15:59