Php 数据库中的Select语句错误
我有一个SELECT语句,但它在MYSQL中给了我一个错误。不知道我做错了什么Php 数据库中的Select语句错误,php,mysql,database,mysqli,Php,Mysql,Database,Mysqli,我有一个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
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
请在问题中添加错误消息Single quotes Missing匹配项为空。
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