On 08-Jul-01 Jonah Klimack wrote:
>
> What I don't want, is the same category name and
> customerID twice, even if it does have an index column
> that differentiates it from other rows.
>
>
> I've tried this:
> ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
> customerID INT UNSIGNED,
> categoryname VARCHAR(20) UNIQUE
>
> but I get an error
>
> Right now I'm trying to figure out what, and how
> to use an index for my situation, but I find the
> mysql docs are badly organized and hard
> to read.
>
Get your duplicates out then:
ALTER TABLE da_table ADD UNIQUE KEY idx_catcus (categoryname,customerID);
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
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