Help: rejecting duplicate rows

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
How can I make MySQL reject duplicate rows when inserting?

The table is quite large: 100+ rows and millions of rows.

MySQL doesn't allow me to create a UNIQUE INDEX for all the rows (16
rows is the max.)

The brute force method (selecting the new row and inserting only when
not found) is way too slow.

Any help is appreciated.

Re: Help: rejecting duplicate rows

On 6 Sep 2005 14:19:05 -0700, in mailing.database.mysql wrote:

Quoted text here. Click to load it

Have a look at the REPLACE INTO command.
REPLACE works exactly like INSERT, except that if an old record in the
table has the same value as a new record on a UNIQUE index or PRIMARY
KEY, the old record is deleted before the new record is inserted.
---------------------------------------------------------------  : Remove your pants to reply

Site Timeline