我有一個搜索jsp,它有多個搜索數據庫的條件(ID或NAME或DATE或...)。我需要一個選擇查詢來滿足所有條件。我已經部分編寫了選擇查詢,但效果不佳。請幫我完成查詢Oracle select查詢條件
select * from table 1
where Id in (select id from table 1 where (those three conditions here)
i have (1=? or id=?)
and (1=? or name=?)
and (1=? or date =?)
但它返回完整的表。我知道這三個條件是正確的。如何修改它以獲得結果。我不想要任何存儲過程,因爲我是一個新手
謝謝@Jeff。這就是我一直在尋找的! – ahairshi