Posted by BB on 11/07/06 17:31
thanks, that worked great
"Anith Sen" <anith@bizdatasolutions.com> wrote in message
news:eiqeuf$1vd8$1@news.ndhu.edu.tw...
> There are different ways you can do this. One option is to use a
> correlated subquery as an additional SQL predicate in the WHERE clause
> like:
>
> ...
> WHERE a.location_id = b.location_id
> AND b.meterno IS NOT NULL
> AND b.meterno = c.meterno
> AND a.location_id = d.location_id
> AND d.creation_date = ( SELECT MAX( d2.creation_date )
> FROM cisdata.Account_Master d2
> WHERE a.location_id = d2.location_id )
> ORDER BY ...
>
> --
> Anith
>
Navigation:
[Reply to this message]
|