开发者

MySQL: select maximum year value from my table?

This is my table:

ID           Value       Year
10           Singapore   2010
10           Malaysia    2009
10           India       2008

Now 开发者_StackOverflowI want to retrieve maximum year record only.

Example:

ID             value       year
10             Singapore   2010

How can I write query in MySQL?


select * from tbl order by year desc limit 1

assuming year is unique

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜