using primary key (col1, col2) makes no index on col2... which is not
good if you lookup only in col2

primary key (col1),
unique index (col2)

don't forget to add "not null" beside your col2 definition.

Etienne

rc wrote:
> 
> why not use a concatenated Primary key?
> 
> create table tname
>   col_name1 int,
>   col_name2 int,
> PRIMARY KEY (col_name1,col_name2)
> 
> you get the drift....
> 
> On Thu, 6 Dec 2001, sherzodR wrote:
> 
> >
> > As far as I know, you can't do tht. What you could do instead is
> > have one Primary Key col and make another one UNIQUE.
> >
> > I did that several times, and it does work!
> >
> >
> 
> ---------------------------------------------------------------------
> 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

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

---------------------------------------------------------------------
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