Subject Re: [firebird-support] how to join two tables
Author Helen Borrie
At 07:54 24/09/2008, you wrote:
>Hello, I want to have a query with some records from a table and after that,
>some records from another table. The only way I can think of doing that is with
>a stored procedure.
>
>pseudocode:
>
>for select (my fields) from table_1 into (my output vars) do
>begin
> suspend;
>end
>
>for select (my fields) from table_2 into (my output vars) do
>begin
> suspend;
>end
>
>Is there another (better) way?
>Both tables has the same field names.

Use a UNION query:

Simple example with matching column names and corresponding compatible data types:

select col1, col3, col5 from tableA
UNION
select col1, col3, col5 from tableB

For more details look up the Language Reference.

./heLen