Created
December 22, 2016 13:41
-
-
Save gracefullight/94bfeaae33efcbf8a7c172769a7984ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT SQL_CALC_FOUND_ROWS @RNUM:=@RNUM+1 AS ROWNUM, R.* FROM ( | |
| SELECT @RNUM:=0, Q.* FROM ( | |
| SELECT * FROM TABLE1 | |
| WHERE ID = '1' | |
| ORDER BY REG DESC | |
| ) Q | |
| ) R | |
| LIMIT 0,10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment