Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select records with Maximum date group by address
Message
 
 
To
30/09/2002 16:06:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00705983
Message ID:
00706218
Views:
24
>Nadya,
>Separate the fields and alias the 'date'. ie:
>
>upper(fr.CCODE) == upper(se.CCODE) and ...
>
>Cetin
select upper(CCODE+TOWN+STREET+str(STNUM,4)+STNUMEXT+UNIT) as Address, * ;
       from (m.tcTableName) fr ;
       where fr.date = (select max(date) ;
       from (m.tcTableName) se where ;
       se.CCODE==fr.ccode and ;
       se.TOWN==fr.Town and ;
       se.StNum==fr.StNum and ;
       se.StNumExt==fr.StNumExt and ;
       se.Unit==fr.Unit  ;
       order by 1 into table (m.lcFile))
Right? I solved it by using two queries instead, but may try this variation as well. It would be interesting to compare the speed too. (BTW, fr - it's short for first and se - short for second :))

Thanks a lot, Cetin.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform