Subject | RE: [firebird-support] selecting some IDs |
---|---|
Author | Leyne, Sean |
Post date | 2010-06-05T17:01:34Z |
Sergio,
Create a temporary temp with a PK index, then join the target table to the temporary table in SQL. The SQL would look like:
SELECT BANCOS.*
FROM BANCOS
JOIN TMP_SELECCION ON TMP_SELECCION.ID = BANCOS.ID
This is functionally equivalent to this alternate SQL:
SELECT BANCOS.*
FROM BANCOS
WHERE
EXISTS ( SELECT 1 FROM TMP_SELECCION WHERE TMP_SELECCION.ID = BANCOS.ID)
Sean
> -----Original Message-----Go with option # 5
> From: firebird-support@yahoogroups.com [mailto:firebird-
> support@yahoogroups.com] On Behalf Of Sergio H. Gonzalez
> Sent: June-04-10 4:24 PM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] selecting some IDs - Email found in subject
>
> Hello, I'm trying to figure out what is the way to a very simple task, so I can
> use the same method from now on...
>
> I want to let the user select some records in order to make a report.
>
> I have some options:
Create a temporary temp with a PK index, then join the target table to the temporary table in SQL. The SQL would look like:
SELECT BANCOS.*
FROM BANCOS
JOIN TMP_SELECCION ON TMP_SELECCION.ID = BANCOS.ID
This is functionally equivalent to this alternate SQL:
SELECT BANCOS.*
FROM BANCOS
WHERE
EXISTS ( SELECT 1 FROM TMP_SELECCION WHERE TMP_SELECCION.ID = BANCOS.ID)
Sean