select *
from teste
where campo1 in ('AAA', 'BBB', ''CCC', 'DDD');
select *
from teste
where campo1 in ('AAA', 'BBB', 'DDD');
Possui algum função no oracle se todos os valores da cláusula "in" existem?
select *
from teste
where campo1 in ('AAA', 'BBB', ''CCC', 'DDD');
select *
from teste
where campo1 in ('AAA', 'BBB', 'DDD');
select *
from teste
where campo1 in ('AAA', 'BBB', ''CCC', 'DDD')
and exists (select 1 from teste where campo1='AAA')
and exists (select 1 from teste where campo1='BBB')
and exists (select 1 from teste where campo1='CCC')
and exists (select 1 from teste where campo1='DDD')
select *
from teste
where campo1 in ('AAA', 'BBB', ''CCC', 'DDD')
and exists (select 1 from teste where campo1='AAA')
and exists (select 1 from teste where campo1='BBB')
and exists (select 1 from teste where campo1='CCC')
and exists (select 1 from teste where campo1='NNN')
Por isso o EXISTS. Faça o teste!só devo retornar se todos existirem.
Usuários navegando neste fórum: Nenhum usuário registrado e 17 visitantes