Created
May 16, 2014 03:06
-
-
Save indiejoseph/d71c199c96ea76bc86db to your computer and use it in GitHub Desktop.
Increment number in MySQL
This file contains 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 | |
`chars`.`id`, | |
@n := @n +1 AS `index` | |
FROM | |
`characters` AS `chars`, | |
(SELECT @n := -1) AS `m`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment