sql >> Base de Datos >  >> RDS >> Mysql

Consulta con varias cláusulas IN en varias filas

select distinct ID from table t1
where (select count(*) from table where ID = t1.ID group by ID) >=2
and (select count(*) from table where Idservice = 5 and ID = t1.ID group by ID) > 0