Blogs related to inserting unique value
Indexes in MySQL
Begin with a table and the data it needs, but without any indexes except those designed to constrain the data to valid
values (primary and
unique indexes). Next, consider the queries that are issued against the table.
...
Predicting how long data load would take
Load Options There two main ways to load data in
MySQL you can use Multiple
value insert (standard mysqldump output) or LOAD DATA INFILE (–tab mysqldump output). Generally LOAD DATA can be optimized better and a bit faster because of
...
MySQL 5.1.18-beta has been released
NDB Cluster:
INSERT IGNORE wrongly ignored NULL
values in
unique indexes. (Bug#27980: http://bugs.
mysql.com/27980) * NDB Cluster: The name of the month "March" was given incorrectly in the cluster error log.
...
Merge Tables Gotcha
Query OK, 0 rows affected, 1 warning (0.03 sec).
mysql>
INSERT INTO t1
VALUES(1);. Query OK, 1 row affected (0.00 sec).
mysql>
INSERT INTO t2
VALUES(1);. Query OK, 1 row affected (0.00 sec).
mysql> SELECT * FROM tm WHERE id=1;
...
Unique strings in a text field
`c` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1
INSERT INTO hmm
VALUES (1, 'hmm8',1) ON DUPLICATE KEY UPDATE b = IF(FIND_IN_SET('hmm8', b)>0, b, CONCAT_WS(',',b, 'hmm8')), c = c+1;
...
inserting unique value
I need to
insert a
unique value into a (not autoincrement) column. I try
insert into idtest (val)
values ((select max(val) from idtest)+1) but I get ERROR 1093 (HY000): You cant specify target table idtest for update in FROM clause wha
...