Subject RE: [firebird-support] newbie question
Author Bill Meaney
>Hello all,
> I am new to firebird and SQL so I am sure this is a stupid
>question but here goes anyway. I have the following two tables

>Table1
> KEY DESCRIPTION
> ------- -------------------
> ZZZA Simple Description one
> ZZZB Simple Description 2
> ZZAA Another Desc 1
> ZZAB Another Desc 2
>
>Table2
> misc cols... Simple Another
> ------------ -------- ---------
> blah blah ZZZA ZZAB
> ...
>
>Anyway, what I would like to do would be to Select every row from
>table2 but I don't want the 4 character description codes, I want to
>return the corresponding description from table1. I got it working
>for one column by using a left outer join but I can not figure out
>how to make it work (and work somewhat effeciently) with two columns
>to subsitute. I hope this makes sense. Any and all help will be
>greatly appreciated.
>
>Thank in advance,
>
>Jay
>

Jay,

You might try this:

select <misc cols>, t1a.Description, t1b.Description
from table2 t2, table1 t1a, table1 t1b
where t2.Simple = t1a.Key
and t2.Another = t1b.Key


Bill