1
我正在嘗試使用IFNULL來確定在where子句中使用列,但我不相信我正確地做了它。有人有任何建議嗎?使用IFNULL選擇Mysql
SELECT * FROM bdesclookuptable
WHERE LOWER('Santa Clause Home Address') LIKE CONCAT('%',LOWER(lText),'%')
AND LOWER('Santa Clause Home Address') LIKE CONCAT('%',LOWER(IFNULL(plusand,'ilikethispaintingoverhead')),'%')
AND LOWER('Santa Clause Home Address') NOT LIKE CONCAT('%',LOWER(IFNULL(andnot,'ilikethispaintingoverhead')),'%');
table
id lText bbid ttype andnot plusand
16 Home Address 11 13 null Santa
17 Home Address 11 13 Work Santa
18 Home Address 12 15 Mrs Clause null
我想這個查詢拉只紀錄的16
add'and id = 16'?解釋你想從你的數據庫中提取什麼plz – 2014-11-20 16:38:54
@BenjaminPoignant我會認爲它不是完全是16,而是關於屬性的組合。其他一切都是毫無意義的。 – glglgl 2014-11-20 16:44:03