mysql排行榜原理

mysql排行榜写法

    $sql = 'select * from (SELECT t.*, @rownum := @rownum + 1 AS rownum
FROM (SELECT @rownum := 0) r, (SELECT * FROM lanchengcocmanghe_oauthinfo ORDER BY id DESC) AS t) ranklist;';
        $info = $this->commonexecute($sql);
        print_r($info);

 

posted @ 2022-01-15 16:48  newmiracle宇宙  阅读(18)  评论(0编辑  收藏  举报