我写了一个sql,它告诉我这个例外,我怎么能解决这个问题
SELECT
b.project_id,
GROUP_CONCAT(b.segment_type ORDER BY b.segment_type SEPARATOR ',' ) AS seg_type
FROM t_project_bid_announce_draft b
LEFT JOIN t_project_segment t ON t.project_id = b.project_id
WHERE (b.review_status = 2 OR b.review_status = 3)
AND b.deleted = 0
AND seg_type != t.segment_type
GROUP BY b.project_id
请帮助我,非常感谢。
更新
我使用不带
的sqlAND seg_type != t.segment_type
像
SELECT b.project_id,GROUP_CONCAT(b.segment_type ORDER BY b.segment_type SEPARATOR ',' )
AS seg_type,t.segment_type
FROM t_project_bid_announce_draft b
LEFT JOIN t_project_segment t ON t.project_id = b.project_id
WHERE (b.review_status = 2 OR b.review_status = 3)
AND b.deleted = 0
GROUP BY b.project_id
而且我得到了这个RESULT
我想比较
seg_type
和
t.segment_type