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
> > > [EMAIL PROTECTED]
> > >
> > > ----- Original Message -----
> > > From: "Gerald Clark" <[EMAIL PROTECTED]>
> > > To: "Vigile" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > 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
> > > > )

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to