|Subject||Re: Subquery Question (FB 1.5)|
Perfect! Thanks for your help. BTW, I will be migrating to FB2.5 soon. Will this continue to work there?
--- In firstname.lastname@example.org, Helen Borrie <helebor@...> wrote:
> At 01:36 AM 8/07/2010, you wrote:
> >Here are the two peices of the query I can't get tied together.
> >Thanks for looking at it.
> > watlev.inventory_pk,
> > watlev.wl_date,
> > watlev.wl_comment
> >/*It is this piece of the SQL Statement I can't seem to puzzle out */
> > (select
> > w.inventory_pk,
> > max( w.wl_date ) max_of_wl_date
> > from watlev w
> > group by w.inventory_pk)
> In Fb 2 and above you could use something like that idea by use of derived tables. For Fb 1.5, try the following:
> watlev w1
> w1.wl_date =
> (select max( w.wl_date ) from watlev w
> where w.inventory_pk = w1.inventory_pk)
> Note here I'm discouraging you from mixing table identifiers with table aliases because it becomes illegal in Fb 2+.