Hi I have a table
price date time
1.0 20100815 1
1.2 20100815 2
1.3 20100815 3
2 20100814 1
3.1 20100813 1
3.2 20100813 2
:
:
:
Now I want to select the latest 3 days price with all the time, I use like this
select price, date from allquotes where date in
(select date from allquotes group by date order by date desc limit 3)
Is this right? Is this efficient? Any suggestion to improve this?
If I would like to show only one price with the latest time, how to do that?
Thanks so much!