"Miroslav I." <[EMAIL PROTECTED]> wrote:
> - how to autonumber rows in SQL result
>
> I would like to put an auto numbering column in any SQL SELECT result, is it 
> possibile?

You can use variables, for example:

mysql> SELECT @id:=0;
+--------+
| @id:=0 |
+--------+
|      0 |
+--------+
1 row in set (0.00 sec)

mysql> SELECT @id:[EMAIL PROTECTED], str FROM test;
+------------+------+
| @id:[EMAIL PROTECTED] | str  |
+------------+------+
|          1 | aaa  |
|          2 | bbb  |
|          3 | ccc  |
+------------+------+
3 rows in set (0.01 sec)

http://www.mysql.com/doc/en/Variables.html
http://www.mysql.com/doc/en/example-user-variables.html




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to