[英]Select statement error in database
我有一個 SELECT 語句,但它在 MYSQL 中給了我一個錯誤。 不知道我做錯了什么。
SELECT input,
CASE WHEN input LIKE %is this to% THEN 10
ELSE CASE WHEN input LIKE %this to you% THEN 12
END END
AS 'matches'
FROM tableName
LIMIT 0 , 30
嘗試這個 :
SELECT input,
CASE
WHEN input LIKE '%is this to%' THEN 10
WHEN input LIKE '%this to you%' THEN 12
ELSE 0
END AS 'matches'
FROM tableName
LIMIT 0 , 30
SELECT input
CASE WHEN input LIKE '%is this to%' THEN 10
ELSE
CASE WHEN input LIKE '%this to you%' THEN 12
END
END
AS 'matches'
FROM tableName
LIMIT 0 , 30
注意'
(單引號)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.