Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 数据库中的Select语句错误_Php_Mysql_Database_Mysqli - Fatal编程技术网

Php 数据库中的Select语句错误

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语句,但它在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

请在问题中添加错误消息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