Re: INSERT DISTINCT?

2004-07-07 Thread Joshua J. Kugler
Certainly, it's called making a unique index on the field(s) you want to keep unique. Hope that helps. j- k- On Wednesday 07 July 2004 12:48 pm, John Mistler said something like: Is there a way to do an INSERT on a table only if no row already exists with the same info for one or

Re: INSERT DISTINCT?

2004-07-07 Thread Justin Swanhart
Create a unique index on each column that you don't want to be duplicated. create UNIQUE index table_u1 on table(some_column) --- John Mistler [EMAIL PROTECTED] wrote: Is there a way to do an INSERT on a table only if no row already exists with the same info for one or more of the columns as

RE: INSERT DISTINCT?

2004-07-07 Thread Matt Chatterley
(obviously put in the appropriate column names etc for your data structure!) Cheers, Matt -Original Message- From: Joshua J. Kugler [mailto:[EMAIL PROTECTED] Sent: 07 July 2004 22:22 To: [EMAIL PROTECTED] Subject: Re: INSERT DISTINCT? Certainly, it's called making a unique index

Re: INSERT DISTINCT?

2004-07-07 Thread David Felio
2004 22:22 To: [EMAIL PROTECTED] Subject: Re: INSERT DISTINCT? Certainly, it's called making a unique index on the field(s) you want to keep unique. Hope that helps. j- k- On Wednesday 07 July 2004 12:48 pm, John Mistler said something like: Is there a way to do an INSERT on a table only

Re: INSERT DISTINCT?

2004-07-07 Thread John Mistler
I am not certain from the documentation whether it is advisable to create a unique multi-column index on two columns that are already individually indexed. The individual indexes I assume I need for when I do a SELECT on those particular columns. The multi-column one I need for the reasons

RE: INSERT DISTINCT?

2004-07-07 Thread Lachlan Mulcahy
is going to generate a duplicate key error when duplicates are found. Hope this clarifies some things for you. Lachlan -Original Message- From: John Mistler [mailto:[EMAIL PROTECTED] Sent: Thursday, 8 July 2004 12:27 PM To: [EMAIL PROTECTED] Subject: Re: INSERT DISTINCT? I am not certain

RE: INSERT DISTINCT?

2004-07-07 Thread Lachlan Mulcahy
direct address, this way everyone can keep track of the discussion. -Original Message- From: John Mistler [mailto:[EMAIL PROTECTED] Sent: Thursday, 8 July 2004 1:24 PM To: Lachlan Mulcahy Subject: Re: INSERT DISTINCT? Thanks, Lachlan! One other thing I am wondering: given two columns (a,b

Re: INSERT DISTINCT?

2004-07-07 Thread Paul DuBois
At 19:26 -0700 7/7/04, John Mistler wrote: I am not certain from the documentation whether it is advisable to create a unique multi-column index on two columns that are already individually indexed. The individual indexes I assume I need for when I do a SELECT on those particular columns. The

Re: INSERT DISTINCT?

2004-07-07 Thread Emmett Bishop
Paul, What about the case where column A is a foreign key? In that case would you be forced to keep the index on column A or could you use the A,B index since A is the left most prefix? Tripp --- Paul DuBois [EMAIL PROTECTED] wrote: At 19:26 -0700 7/7/04, John Mistler wrote: I am not

Re: INSERT DISTINCT?

2004-07-07 Thread Michael Stassen
From the manual http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html: In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. In the referenced table, there must be an index where the referenced columns