List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:April 6 2001 5:50pm
Subject:Re: Duplicate of Everything in Table
View as plain text  
You need to specify those columns that need to form a unique
combination,


"Thalis A. Kalfigopoulos" wrote:
> 
> Actually you don't have to specify all columns in the UNIQUE index. Just one of them,
> and the entire row will be dropped for all redundant copies.
> 
> So just do:
> ALTER IGNORE TABLE lala ADD UNIQUE (PageID);
> 
> I didn't remember the IGNORE thing. Nice idea...
> 
> regards,
> thalis
> 
> On Fri, 6 Apr 2001, Gerald Clark wrote:
> 
> > Are you checking the manual and following along, or just plugging in my
> > hints?
> >
> > You have to specify a length for the text fields.
> > Your total key length must be less than 256 if I remember correctly.
> > Choose values that are long enough to be unique.
> > EX:
> >
> > ALTER IGNORE TABLE Pages ADD UNIQUE ( PageID, ArticleID, PageTitle(25),
> > Text(100))
> >
> > Vigile wrote:
> > >
> > > That gave me:
> > >
> > > SQL-query:
> > >
> > > ALTER IGNORE TABLE Pages ADD UNIQUE ( PageID, ArticleID, PageTitle, Text
> > > )
> > > MySQL said: BLOB column 'PageTitle' used in key specification without a
> key
> > > length
> > >
> > > I guess because PageTitle and Text are [text] fields I can't do that.
> > >
> > > Ryan Shrout
> > > Production Manager
> > > Athlonmb.com
> > > http://www.athlonmb.com
> > > rshrout@stripped
> > >
> > > ----- Original Message -----
> > > From: "Gerald Clark" <gerald_clark@stripped>
> > > To: "Vigile" <vigile@stripped>
> > > Cc: <mysql@stripped>
> > > Sent: Friday, April 06, 2001 9:54 AM
> > > Subject: Re: Duplicate of Everything in Table
> > >
> > > > Sorry:
> > > > ALTER IGNORE TABLE Pages ADD UNIQUE ( PageID, ArticleID, PageTitle,
> Text
> > > > )
Thread
Duplicate of Everything in TableVigile6 Apr
  • Re: Duplicate of Everything in TableGerald Clark6 Apr
  • Re: Duplicate of Everything in TableVigile6 Apr
  • Re: Duplicate of Everything in TableGerald Clark6 Apr
  • Re: Duplicate of Everything in TableVigile6 Apr
  • Re: Duplicate of Everything in TableGerald Clark6 Apr
    • Re: Duplicate of Everything in TableThalis A. Kalfigopoulos6 Apr
      • Re: Duplicate of Everything in TableGerald Clark6 Apr
        • Re: Duplicate of Everything in TableThalis A. Kalfigopoulos6 Apr