我有这样的查询:
SELECT ap.person_id FROM
(SELECT distinct ac.person_id person_id,ac.user_id
FROM zrm_actor ac WHERE ac.deleted != 1) ap
WHERE person_id IS NOT NULL
GROUP BY person_id HAVING COUNT(*) > 1;
如何编写带有条件的查询?
答案 0 :(得分:0)
无法通过与实体不匹配的子选择创建子条件。
SELECT distinct ac.person_id person_id,ac.user_id
FROM zrm_actor ac WHERE ac.deleted != 1
上述查询与任何实体都不匹配,因此无法从中创建子条件。