Subject | Re: newbie question |
---|---|
Author | jaybirdbsu |
Post date | 2004-08-31T21:22:32Z |
--- In firebird-support@yahoogroups.com, Lester Caine <lester@l...>
wrote:
have to do this way and it works, but it does take a bit to execute.
wrote:
> jaybirdbsu wrote:from
>
> > 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
> > table2 but I don't want the 4 character description codes, Iwant to
> > return the corresponding description from table1. I got itworking
> > for one column by using a left outer join but I can not figureout
> > how to make it work (and work somewhat effeciently) with twocolumns
> > to subsitute. I hope this makes sense. Any and all help willbe
> > greatly appreciated.Thanks Lester! I tried it and it works. I actually have 7 values I
>
> SELECT
> misc cols,
> ( SELECT DESCRIPTION FROM Table1
> WHERE KEY = Table2.Simple ) AS Simple,
> ( SELECT DESCRIPTION FROM Table1
> WHERE KEY = Table2.Another ) AS Another
> FROM Table2
>
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services
have to do this way and it works, but it does take a bit to execute.