0
我有一個查詢MySQL的where子句沒有返回預期值
SELECT *
FROM hayabusa.customer_staging
WHERE tin = "888-596-592"
OR gsis_sss_no = "bp0279638"
OR last_name LIKE "%dela cruz%"
OR first_name LIKE "%jose%"
OR date_of_birth = "8/8/1978"
OR gender = "male"
AND parent_id = 0
AND is_proccessed = 0
AND id > 27
AND (filename = "sample cif csv file - copy.csv"
OR filename = "sample cif csv file2.csv")
GROUP BY tin,
gsis_sss_no,
last_name,
first_name,
date_of_birth,
gender
ORDER BY CASE
WHEN tin = "888-596-592" THEN 1
ELSE 2
end,
id
LIMIT 1;
但它返回一排3的id
和filename
這不是where
子句。它有什麼問題?
當您使用OR和AND時,請始終使用禁忌符號。嘗試添加這些,一切都應該很好 –
你能分享你認爲不正確的完整記錄嗎? –