0

I have a query like this:

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;

How can I write this query with criteria?

Lee Mac
  • 15,615
  • 6
  • 32
  • 80
sajjad jafari
  • 176
  • 1
  • 2
  • 13

1 Answers1

0

There is no way to create sub-criteria from a sub-select that it's not match an entity.

SELECT distinct ac.person_id person_id,ac.user_id 
 FROM zrm_actor ac WHERE ac.deleted != 1

The above query don't match with any entity, so there is no way to create sub-criteria from it.

sajjad jafari
  • 176
  • 1
  • 2
  • 13