Subject | AW: [firebird-support] select in (subquery) |
---|---|
Author | Alexander Gräf |
Post date | 2004-12-01T01:38:54Z |
> -----Ursprüngliche Nachricht-----If you want a join, why not simply use a join. These "IN" and "EXISTS" statements proved several times to be too slow. They are simply fast when you don't retrieve too many records, or if they are static.
> Von: Mauricio I Magni [mailto:mmagni@...]
> Gesendet: Mittwoch, 1. Dezember 2004 02:27
> An: firebird-support@yahoogroups.com
> Betreff: RE: [firebird-support] select in (subquery)
>
>
> Is there a way to make the engine work with "in" clause like a join?
>
Why not try:
select Personas.Apellido, Personas.Nombre from Personas
INNER JOIN Beneficiarios ON
(Personas.Persona_id = Beneficiarios.Persona_id
and Beneficiarios.Beneficiario_Titular_Id = :Titular_ID)
or (I dont know what yields the result you are searching for)
select Personas.Apellido, Personas.Nombre from Personas
INNER JOIN Beneficiarios ON
Personas.Persona_id = Beneficiarios.Persona_id
WHERE Beneficiarios.Beneficiario_Titular_Id = :Titular_ID
Hope that helps, Alex