1
嗨,我想寫一個查詢使用,如果在where子句 請建議我怎麼能做到這一點我在那裏的條件如下如果條件在MySQL查詢生成的條款動態
IF(`page_type` ==1, `pages NOT LIKE '%ads/indian-institute-of-technology-bombay.html%'
OR pages NOT LIKE '%ads/*%' OR pages NOT LIKE '%indian-institute-of-technology-bombay.html/*%'` ,` pages LIKE '%ads/indian-institute-of-technology-bombay.html%'
OR pages LIKE '%ads/*%' OR
pages LIKE '%indian-institute-of-technology-bombay.html/*%'`)
全面查詢
SELECT * FROM `app_slides` WHERE IF(`page_type` ==1, `pages NOT LIKE '%ads/indian-institute-of-technology-bombay.html%' OR pages NOT LIKE '%ads/*%' OR pages NOT LIKE '%indian-institute-of-technology-bombay.html/*%'` ,` pages LIKE '%ads/indian-institute-of-technology-bombay.html%' OR pages LIKE '%ads/*%' OR pages LIKE '%indian-institute-of-technology-bombay.html/*%'`)
您能向我們展示您的完整查詢,謝謝。 –
是的,先生給我一分鐘 – Deepesh
你能詳細解釋一下你想用if語句做什麼。如果你嘗試執行查詢,是否有錯誤? – brenners1302