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语句答案 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