开发者

How do I select top ranker by date in MySQL

I do have a user data base with rank.what I am looking is how do I select top rank person based on today's search开发者_如何学C?? and I need to do this in daily basis.


This will do:

SELECT id, rank, something 
FROM person 
WHERE date = DATE(NOW()) 
ORDER BY rank DESC LIMIT 1;


Try:

SELECT MAX(rank), id 
  FROM mytbl
 WHERE date = mydate
 GROUP BY id
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜