数据库
首页 > 数据库> > mysql查询自己的排名

mysql查询自己的排名

作者:互联网

SELECT b.id,b.uid,b.nickname,b.like,b.head,b.img,b.content,b.status, b.ranking FROM (SELECT t.*, @ranking := @ranking + 1 AS ranking FROM (SELECT @ranking := 0) r,
                    (SELECT id,nickname,uid,`like`, head,img,content, status FROM tp_blessing WHERE status=1 ORDER BY `like` DESC) AS t) AS b WHERE  b.status=1 AND b.uid={$uid} 

 

TRANSLATE with x English
Arabic Hebrew Polish
Bulgarian Hindi Portuguese
Catalan Hmong Daw Romanian
Chinese Simplified Hungarian Russian
Chinese Traditional Indonesian Slovak
Czech Italian Slovenian
Danish Japanese Spanish
Dutch Klingon Swedish
English Korean Thai
Estonian Latvian Turkish
Finnish Lithuanian Ukrainian
French Malay Urdu
German Maltese Vietnamese
Greek Norwegian Welsh
Haitian Creole Persian  
  TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back

标签:status,ranking,uid,查询,location,mysql,排名,SELECT,like
来源: https://www.cnblogs.com/Abner3721/p/15872270.html