MySQL错误:操作数应包含1列

时间:2015-07-30 12:40:17

标签: mysql

SELECT DISTINCT s.dynamicFormId, max(s.version) FROM seralityportletpreferences s
INNER JOIN dynamicForm d on d.dynamicFormId = s.dynamicFormId
WHERE s.seralitypreferences LIKE CONCAT('%',(SELECT DISTINCT blockId, version FROM formBlock WHERE groupId = 10609 AND blockContent like '%911%'),'%')
GROUP BY d.dynamicFormId

请告诉我我错在哪里。我在like子句

中使用select语句

1 个答案:

答案 0 :(得分:0)

尝试此查询

SELECT DISTINCT s.dynamicFormId, max(s.version) FROM seralityportletpreferences s
INNER JOIN dynamicForm d on d.dynamicFormId = s.dynamicFormId
WHERE s.seralitypreferences LIKE CONCAT('%',IFNULL((SELECT DISTINCT convert(varchar(50), blockId), version FROM formBlock WHERE groupId = 10609 AND blockContent like '%911%'),''),'%')
GROUP BY d.dynamicFormId