List: | General Discussion | « Previous MessageNext Message » | |
From: | Augey Mikus | Date: | May 10 2002 10:00pm |
Subject: | Re: quick sql question | ||
View as plain text |
is there a way for me to do it in a mysql delete statement? just out of curiosity, for instance, if i wanted to add duplicates later for whatever reason. Paul DuBois wrote: > At 17:54 -0400 5/10/02, Augey Mikus wrote: > >> what i meant is deleting duplicate occurences of records of a certain >> field. ...sorry... > > > Ah. > > One thing you can do is add a unique index on that field with > ALTER IGNORE TABLE tbl_name ADD UNIQUE (col_name) > or > ALTER IGNORE TABLE tbl_name ADD PRIMARY KEY (col_name) > > and MySQL will clobber duplicate records as it builds the index. > >> >> >> Paul DuBois wrote: >> >>> At 17:16 -0400 5/10/02, Augey Mikus wrote: >>> >>>> what is the simplest way to delete duplicate occurences of a >>>> specific field in mysql? >>>> >>>> thanks, >>>> >>>> augey >>> >>> >>> >>> Your question is a bit ambiguous. You could do this by using ALTER >>> TABLE to remove the column itself from the table, for example, but >>> I'm guessing maybe that's not what you mean. >> > >
Thread | ||
---|---|---|
• quick sql question | Augey Mikus | 10 May |
• Re: quick sql question | Paul DuBois | 10 May |
• Re: quick sql question | Augey Mikus | 10 May |
• Re: quick sql question | Paul DuBois | 10 May |
• Re: quick sql question | Augey Mikus | 10 May |
• Re: quick sql question | Paul DuBois | 10 May |
• Re: quick sql question | Augey Mikus | 11 May |
• Re: quick sql question | Augey Mikus | 11 May |
• Re: quick sql question | Paul DuBois | 11 May |
• Repair with key cache | sup-mysql | 11 May |
• Re: Repair with key cache | Benjamin Pflugmann | 11 May |
• Re: Repair with key cache | sup-mysql | 11 May |
• Re: Repair with key cache | Paul DuBois | 12 May |
• Re: Repair with key cache | sup-mysql | 12 May |
• Re: Repair with key cache | sup-mysql | 12 May |
• Re: Repair with key cache | Paul DuBois | 12 May |
• Re: Repair with key cache | sup-mysql | 12 May |
• Re: Repair with key cache | Jeremy Zawodny | 12 May |
• RE: Repair with key cache | Ramon Arias | 13 May |
• Re: Repair with key cache | Jeremy Zawodny | 13 May |
• Re: quick sql question | Augey Mikus | 11 May |