2017-03-02 103 views
-2

我試圖尋找從此刻的數據庫納稅申報,所以我加了哪裏像下面SQL通配符選擇

WHERE (memo LIKE '%TAX%'AND memo NOT LIKE '%TAXI%') 
OR memo NOT LIKE '%IRS%' 
OR memo LIKE '%BOFI RAC%' 
OR memo LIKE '%EPS RFND%' 
OR memo LIKE '%REPUBLIC TRS RT FED%' 
OR memo LIKE '%TA PAYMENT%' 
OR memo LIKE '%JTHF-EA JTHF ADV%' 
OR memo LIKE '%REFUND ADVANTAGE ELEC REFND%' 
OR memo LIKE '%TAX PRODUCTS PE3%' 

然而,有一個結果PAYPAL TRANSFER條款彈出。

對此有何看法?

+1

''PAYPAL TRANSFER''(與許多其他的備忘錄,我假設)不包含‘IRS’,以使其符合您的條件。 –

+0

是否有排除國稅局,並不讓不相關的結果彈出? @GordonLinoff – YOBOX

+0

'像任何數據(數組['%TAX%','%BOFI RAC%','%EPS RFND%',...]和備忘錄不像所有數組['%TAXI%', '%IRS%'])' – Abelisto

回答

0

我想你想:

WHERE (memo NOT LIKE '%IRS%' AND 
     (memo LIKE '%TAX%'AND memo NOT LIKE '%TAXI%') OR 
     memo LIKE '%BOFI RAC%' OR 
     memo LIKE '%EPS RFND%' OR 
     memo LIKE '%REPUBLIC TRS RT FED%' OR 
     memo LIKE '%TA PAYMENT%' OR 
     memo LIKE '%JTHF-EA JTHF ADV%' OR 
     memo LIKE '%REFUND ADVANTAGE ELEC REFND%' OR 
     memo LIKE '%TAX PRODUCTS PE3%' 
     ) 
    )