I have this statement:
SELECT riesgo
FROM CI_Riesgo
WHERE proceso LIKE '21.2 Seguridad Institucional en Oficinas Centrales'
AND riesgo NOT IN (SELECT nomRiesgo FROM CI_Riesgo_T WHERE estadoRiesgo LIKE 'En%' OR estadoRiesgo LIKE '%Asignado%')
But the tool where I'm going to run it doesn't contain the IN expression (don't ask why) so I can't run that statement.
So I'm looking for a way to do a different statement with the same results. Is there any way?
An alternative (which I don't know if your tool supports), would be to use
NOT EXISTS
:As a side note, the way you're using
LIKE
in the first conditionWHERE
is the same as simply using=
, since it doesn't have wildcards.If for some unknown reason you can't use
NOT EXISTS
, then you could use aLEFT JOIN
: