Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
 
 
To
07/02/2011 12:45:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Miscellaneous
Thread ID:
01499047
Message ID:
01499049
Views:
48
>Hi Expert
>
>I have a Table of about 100000 records of about 3000 Codes. I want to select Code,Last Pur.Rate with Date of each code.
>
>Thnx in advance
>
>Rgds:
>Ahsan Rana

One of the possibilities
select T1.* from Codes T1 inner join (select Code, max(Rate) as MaxRate from Codes group by Code) T2
on T1.Code = T2.Code and T1.Rate = T2.MaxRate
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform