I write a query and give a table in output but I want to every row of my table has a number automatically that starts from 1. for example , I want that my table has “number” column that first row of my table have 1 in that column , second row of my table have 2 in that column , third row of my table have 3 in that column , …
How can I do this ?
thanks
** My DBMS is MySQL **
Use a variable and increment it like following.
Example
Note: If you use
*make sure it precedes.