how to generates indexes for a query
MySQL
1
Posts
1
Posters
1
Views
1
Watching
-
Lets say I run a query on a table and it returns the record with ids 2,4 and 6. My id is auto incremented number which is incremented automatically for each inserted record. I dont want to use these ids but rather want to generate my own index which starts for 0 or 1. In this case my indexes should be (1, 2, 3). How can i do it? Thanks in advance. Lets say my table name is 'students'
SELECT * from students
The above code returns the actual id's field which may not be consecutive. I want to generate my own indexes which are in ascending order 1, 2, 3 ...