Salut
max@max-laptop:~$ su
Password:
root@max-laptop:/home/max# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.38-Ubuntu_0ubuntu1-log Ubuntu 7.04 distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> USE test
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> CREATE TABLE test(id INT UNSIGNED AUTO_INCREMENT, autre INT, PRIMARY KEY(id));
Query OK, 0 rows affected (0.23 sec)
mysql> INSERT INTO test(autre) VALUES(1), (2), (3), (4), (5), (6), (7);
Query OK, 7 rows affected (0.06 sec)
Records: 7 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM test;
+----+-------+
| id | autre |
+----+-------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
+----+-------+
7 rows in set (0.00 sec)
mysql> DELETE FROM test WHERE id=4;
Query OK, 1 row affected (0.15 sec)
mysql> DELETE FROM test WHERE id=3;
Query OK, 1 row affected (0.00 sec)
mysql> CREATE TEMPORARY TABLE tmp (id INT UNSIGNED auto_increment, autre int, primary key(id));
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO tmp(autre) (SELECT autre FROM test ORDER BY id)
-> ;
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM tmp
-> ;
+----+-------+
| id | autre |
+----+-------+
| 1 | 1 |
| 2 | 2 |
| 3 | 5 |
| 4 | 6 |
| 5 | 7 |
+----+-------+
5 rows in set (0.00 sec)
mysql> DELETE FROM test;
Query OK, 5 rows affected (0.00 sec)
mysql> INSERT INTO test(id, autre) (SELECT id, autre FROM tmp);
Query OK, 5 rows affected (0.00 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> SELECT * FROM test;
+----+-------+
| id | autre |
+----+-------+
| 1 | 1 |
| 2 | 2 |
| 3 | 5 |
| 4 | 6 |
| 5 | 7 |
+----+-------+
5 rows in set (0.00 sec)
Voila, j'espere que ca repond a ta question
une
recherche sur exalead vous aurait peut-etre evite de poser cette question
In a dream, I saw me, drop dead...
U were there, U cried...
It was just a dream,
if I die, U won't cry, maybe, U'll be happy