Re: duplicate records check

2003-07-09 Thread Nils Valentin
Hi Neil, 1) You could ask for the count of each listed item in a column. something like: SELECT item, count(item) from parts GROUP BY item; 2) you could then use SELECT id,item from parts WHERE item = 'xxx'; to review the double entries. This is just a general sample, perhaps if you give mo

RE: duplicate records check

2003-07-08 Thread Kalis, Frank
Title: RE: duplicate records check Hi Neil, try something like this SELECT FROM GROUP BY HAVING COUNT(*) > 1 Mit freundlichen GrĂ¼ssen Frank Kalis Asset Management ProACTIV___ CiV Versicherungen * PB Versicherungen * PB Pensionsfonds

Re: Duplicate records

2003-06-06 Thread Peter Brawley
Insert. PB - - Original Message - From: John Griffin To: Steve Marquez ; MySQL List Cc: PHP eMail List Sent: Friday, June 06, 2003 2:51 PM Subject: RE: Duplicate records Hello Steve, Do a select on the record before you insert it. If the record does not exist in the

RE: Duplicate records

2003-06-06 Thread Mike Hillyer
You can always catch the Duplicate Key error and respond accordingly in your PHP script. Regards, Mike Hillyer www.vbmysql.com -Original Message- From: Steve Marquez [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 1:41 PM To: MySQL List Cc: PHP eMail List Subject: Duplicate records

RE: Duplicate records

2003-06-06 Thread John Griffin
Hello Steve, Do a select on the record before you insert it. If the record does not exist in the database (i.e. mysql_num_rows () == 0) than it is safe to do the insert. John -Original Message- From: Steve Marquez [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 3:41 PM To: MySQL L

Re: Duplicate Records

2002-02-13 Thread rc
any reason not to select distinct into a tmp table? On Sun, 10 Feb 2002, DL Neil wrote: > Rich, > > > How does one go about removing one of two identical records in a MySQL > > database? My mistake in an earlier database was not applying a unique > > number to each record (1, 2, 3, ---). I kn

RE: Duplicate Records

2002-02-13 Thread Rick Emery
A quick method is to create a new table: CREATE TABLE newtable SELECT DISTINCT * FROM oldtable; note; manually verify newtable has your data. Then proceed: DROP TABLE oldtable; CREATE TABLE oldtable SELECT * FROM newtable; DROP TABLE newtable; -Original Message- From: Rich [mailto:[E

Re: Duplicate Records

2002-02-12 Thread DL Neil
Dan, [I've cc-ed this to the list and to Rich - who asked the original question] > You can do the following to remove duplicates: > > - create table foo as select distinct cols from > table_name_containing_duplicates; > - drop table_name_containing_duplicates; > - alter table foo rename to table_

Re: Duplicate Records

2002-02-12 Thread Fournier Jocelyn [Presence-PC]
Hi, You can try to use ALTER IGNORE TABLE syntax : ALTER IGNORE TABLE your_table ADD UNIQUE(Id); Regards, Jocelyn Fournier - Original Message - From: "Rich" <[EMAIL PROTECTED]> To: "MySql" <[EMAIL PROTECTED]> Sent: Sunday, February 10, 2002 5:31 PM Subject: Duplicate Records > How do

Re: Duplicate Records

2002-02-12 Thread DL Neil
Rich, > How does one go about removing one of two identical records in a MySQL > database? My mistake in an earlier database was not applying a unique > number to each record (1, 2, 3, ---). I know it's possible to use the > DISTINCT operator to show only one of the identical records in a resul

RE: Duplicate Records

2002-02-10 Thread Daniel Rosher
avoid duplicates. Regards, Dan > -Original Message- > From: DL Neil [mailto:[EMAIL PROTECTED]] > Sent: Monday, 11 February 2002 8:30 a.m. > To: Rich; MySql > Subject: Re: Duplicate Records > > > Rich, > > > How does one go about removing one of two identica

Re: Duplicate Records

2002-02-10 Thread Fournier Jocelyn [Presence-PC]
Hi, You can try to use ALTER IGNORE TABLE syntax : ALTER IGNORE TABLE your_table ADD UNIQUE(Id); Regards, Jocelyn Fournier - Original Message - From: "Rich" <[EMAIL PROTECTED]> To: "MySql" <[EMAIL PROTECTED]> Sent: Sunday, February 10, 2002 5:31 PM Subject: Duplicate Records > How do

Re: Duplicate Records

2002-02-10 Thread DL Neil
Rich, > How does one go about removing one of two identical records in a MySQL > database? My mistake in an earlier database was not applying a unique > number to each record (1, 2, 3, ---). I know it's possible to use the > DISTINCT operator to show only one of the identical records in a resul

RE: Duplicate Records

2002-02-10 Thread Todd Williamsen
First off, You would need to add an "id" field, then set it to a primary key, then set it to "auto_increment" This will order them correctly -Original Message- From: Rich [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 10, 2002 10:31 AM To: MySql Subject: Duplicate Records How does

RE: duplicate records, auto-increment problems, question

2001-03-28 Thread Cal Evans
Good morning Eve! Sorry it has taken me so long to answer. 1: This is normal behavior. Your confusion here is thinking that an auto_increment field is a record number.. It's not. It's simply a counter. It does not ensure that you always have a contiguous sequence of numbers starting form 1. It