This is a discussion on how to add an autoincrement field in a select within the MySQL forums, part of the Database Server Software category; --> Hello from Italy! I have a table students with fields name and age I need to do a select ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello from Italy! I have a table students with fields name and age I need to do a select query like: select name from students where I would like to add a field that is auto-increment, so the query result must be: id, name 1 mario 2 gino 3 saverio 4 ... But I don't now how I can put a auto-increment field in a select statement... Can anyone help me? Thanks! |
| ||||
| nintesa wrote: > Hello from Italy! > > > I have a table students with fields name and age > > I need to do a select query like: > > select name > from students > > where I would like to add a field that is auto-increment, so the query > result must be: > > id, name > 1 mario > 2 gino > 3 saverio > 4 ... > > But I don't now how I can put a auto-increment field in a select > statement... > > Can anyone help me? > > Thanks! http://forums.mysql.com/read.php?10,36490,36511 |