0
我是MySQL的新手。我有一個select語句,我一直在努力,我得到一個語法錯誤(錯誤代碼:1064)。在下面的查詢//////////之間的部分表示已經有語法錯誤:語法錯誤在我的SELECT語句中,在Where子句中的Case
SELECT * FROM `customers` WHERE
First_name !='0' And
Last_name !='0' And
(Phone !='0' And Phone >= 10 And Phone Not like '111%' And Phone Not like '222%' And Phone Not like '333%' And Phone Not like '444%' And Phone Not like '555%' And Phone Not like '666%' And Phone Not like '777%' And Phone Not like '888%' And Phone Not like '999%' And Phone Not like '800%' And Phone Not like '877%' And Phone Not like '866%' And Phone Not like '911%' And Phone Not like '123%' And Phone Not like '1%' And Phone Not like '0%') And
Age !='0' And
Gender !='0' And
////////////////////////////////////////////
(Marital_status !='0' or Case when Marital_status = 'Single' then ((Age between 25 to 75)(Gender='Female' and Annual_income is between $40k to $200k)(Gender='Female')(Zip_code is between 90000 to 93099))or Case when Marital_status='Cohab' then ((Age between 25 to 75)(Annual_income >= 40000)(Zip_code is between 90000 to 93099)) or Case when Marital_status='Married' then ((Age between 25 to 75)(Annual_income is between $40k to $200k)(Zip_code is between 90000 to 93099))) And
/////////////////////////////////////////////
Annual_income !='0' And
Zip_code !='0'
請分享您的錯誤消息。 – fejd