All pastes #795917 Raw Edit

Anonymous

public text v1 · immutable
#795917 ·published 2007-11-24 16:16 UTC
rendered paste body
mysql> create table t ( hotel varchar(255), poradi int );
Query OK, 0 rows affected (0.02 sec)

mysql> insert into t values ("hotel1", 1);
Query OK, 1 row affected (0.00 sec)

mysql> insert into t select "hotel ester", max(poradi)+1 from t;
Query OK, 1 row affected (0.00 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> select * from t;
+-------------+--------+
| hotel       | poradi |
+-------------+--------+
| hotel1      |      1 | 
| hotel ester |      2 | 
+-------------+--------+
2 rows in set (0.00 sec)

mysql>