Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement
Message
 
 
To
07/02/2011 13:07:20
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:
01499062
Views:
43
>My requirement is not max rate, I want to select Last Purchase Rate of each code
>
>Rgds:
>Ahsan Rana

Do you mean last rate by date? If so, change my query this way:
select T1.* from Codes T1 inner join (select Code, max(date) as LastDate from Codes group by Code) T2
on T1.Code = T2.Code and T1.Date = T2.LastDate && If you have exact same dates for a code all records with last date will be selected
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