Recommended Answers
Jump to PostActually it do not affect any changes -
on duplicate update ...
in your example supress error message. The same can be achieved withinsert ignore into table ...
Jump to PostIts id who you try to insert as duplicate - result is no changes and supress error message
Jump to PostE.g.
drop table if exists test_table; create table test_table( id int not null auto_increment primary key ,test varchar(30) null ,unique key (test) ); insert into test_table(test) values('1 sample string'); insert into test_table(test) values('2 sample string'); insert into test_table(test) values('3 sample string');
when you try to repeat any …
Jump to PostI don't understand how that works. From what I read the code says
Get a new id which is one more than the last inserted key and if the new id already exists then just update the existing record else insert a new record
To me that …
Jump to PostThe difference is your brain is young and smart and mine is not as much ;-P
I interpreted AUTO_INCREMENT as AUTO_INCREMENTED.
All 31 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.