Re: SQL Header/detail problem

From: Sandeep Gupta <sandeep_bpl_at_yahoo.com>
Date: 18 May 2002 03:41:39 -0700
Message-ID: <c89fe0be.0205180241.1516187c_at_posting.google.com>


select a.num, max(b.num)
from header a, detail b
where (b.num <= a.num)
group by a.num

Ciao :)
-S

ed.prochak_at_alltel.com (Ed prochak) wrote in message news:<e51b160.0205170931.1f1b579f_at_posting.google.com>...
> hdenooijer_at_hotmail.com (Hennie de Nooijer) wrote in message news:<191115aa.0205160326.1e9f948e_at_posting.google.com>...
> > Hi i,ve a problem with a result i've to create from a header/detail
> > problem. under is a example given and a result. Can anybody help me
> > with SQL query???
> > In Words : For every header i have to find a detail equals the
> > headernumber or the than highest number lower than the headernumber.
> > Example
> >
 [snip]
> >
> > Can anybody give me a clue??? Appreciate this
> >
> > Greetz
> > Hennie
>
>
> Use a correlated subquery.
>
> (all you wanted was a clue. 8^)
>
>
> HTH
> Ed
Received on Sat May 18 2002 - 12:41:39 CEST

Original text of this message