Reputation: 2935
I have a table named "accounts" and it has two fields "month" and "amount". I like to get highest month records to display front page
eg:
month amount
10/2013 -> 12
12/2013 -> 20
12/2013 -> 21
11/2013 -> 10
how could i filter highest month all data , I used time stamp format to store date
Upvotes: 1
Views: 63
Reputation: 13551
SELECT * FROM accounts WHERE month = (SELECT MAX(month) FROM accounts)
Upvotes: 2