New answers tagged order-by
Try it this way SELECT id, rank, @rownum := IF(rank = @prevrank, @rownum, @rownum + 1) myorder, @prevrank := rank previousRank FROM ( SELECT mro.id, mro.rank FROM myRankorder mro JOIN rankGroup rg ON rg.id = mro.groupid WHERE rg.groupid = 1 ORDER BY mro.rank DESC ) q CROSS JOIN ( SELECT @rownum := 0, @prevrank := ...
I tried your schema / query on SqlFiddle with: MySql 5.5.32 (show here) MySql 5.6.6 m9 (show here) and work fine together. Please check your PhpMyAdmin possibly fault
Top 50 recent answers are included