sql >> Base de Datos >  >> RDS >> Oracle

Registro de selección de Oracle con condición de columna múltiple

Cuente las filas relevantes. Si solo se necesita un nombre

select ename
from mytable
where event in (37,49) and date is null
group by ename
having count(*) = 2

EDITAR

Siguiendo un nuevo conjunto de condiciones

select distinct ename
from mytable t1
where not exists ( 
    select 1 
    from mytable t2
    where t2.ename = t1.ename and t2.event in (37,49) and t2.date is not NULL)
    ;