Subject | Re: newbie question |
---|---|
Author | jaybirdbsu |
Post date | 2004-08-31T21:24:39Z |
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
Thanks for the quick reply, this group is really helpful. I tried
the subselects and it works. I actually have 7 columns to do the
subselects with and it does take a bit to execute but it does work.
Thanks again,
Jay
<aharrison@i...> wrote:
> At 04:19 PM 8/31/2004, jaybirdbsu wrote:Ann,
> >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
> > ...
>
> Not my favorite, but subselects are probably the way to
> go with this:
>
>
> select <misc cols ...>,
> (select t1a.description
> from table1 t1a
> where t1a.key = t2.simple) as simple,
> (select t1b.description
> from table1 t1b
> where t1b.key = t2.another) as another
> from table2 t2
>
>
> regards,
>
>
> Ann
Thanks for the quick reply, this group is really helpful. I tried
the subselects and it works. I actually have 7 columns to do the
subselects with and it does take a bit to execute but it does work.
Thanks again,
Jay