#1241 - 操作数应包含1列

时间:2016-06-07 04:39:13

标签: mysql

我找不到这里的问题以及为什么我得到#1241的错误 - 操作数应该包含1列

SELECT COUNT(*) FROM `User` `t`
INNER JOIN
(
    SELECT cv.relatedId
    FROM CustomValue cv
    WHERE (cv.customFieldId=9 AND (cv.fieldValue = '1')) OR
          (cv.customFieldId=8 AND (cv.fieldValue = '1'))
    GROUP BY cv.relatedId
    HAVING count(*) > 1
) tblcv
    ON tblcv.relatedId = t.id
WHERE (firstName LIKE '%Jea%') AND (keywords like 52,53,54)

enter image description here

1 个答案:

答案 0 :(得分:3)

您不应该使用(keywords like 52,53,54)

您可以使用keywords in (52,53,54)

keywords like '52,53,54'

<强>编辑:

或许你想要这个;)

(find_in_set('52', keywords) or find_in_set('53', keywords) or find_in_set('54', keywords))

或者keywords regexp '52|53|54',这完全取决于您的要求。