that doesn't create two primay keys
it uses both colums to form the primary key, which is A LOT different.

if you use primary key (a,b) be sure to put a and b not null AND unique.
otherwise you could have duplicates in either of these rows.
also, if you are fetching rows based on b, it WILL NOT use the index,
which is not the intended result.

so primary key (a,b) is ok but you need to add either 
unique key(b) 
or 
unique key(b,a)

Etienne

"A. Clausen" wrote:
> 
> I do it all the time, just go
> 
> primary key c (a,b)
> 
> ----
> A. Clausen             [EMAIL PROTECTED]
> 
> ----- Original Message -----
> From: "sherzodR" <[EMAIL PROTECTED]>
> To: "Demirchyan Oganes-AOD098" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Thursday, December 06, 2001 11:58
> Subject: Re: Creating MySQL table w/2 primary keys
> 
> >
> > 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!
> >
> > --
> >
> > What they need to teach in school is for people to think for themselves.
> :-)
> >              -- Larry Wall in <[EMAIL PROTECTED]>
> >
> > Demirchyan Oganes-AOD098 wrote:
> >
> >     DO: Hello everyone,
> >     DO:
> >     DO: I have this create table statement,
> >     DO:
> >     DO: drop table IF EXISTS GROUP_CONCLUSION_GROUPING CASCADE;
> >     DO:
> >     DO: CREATE TABLE IF NOT EXISTS GROUP_CONCLUSION_GROUPING(
> >     DO: ANALYSIS_RESULT_ID     MEDIUMINT(20)  PRIMARY KEY REFERENCES
> PAD_ANALYSIS_RESULT(ANALYSIS_RESULT_ID),
> >     DO: GROUP_CONCLUSION_ID    MEDIUMINT(20)  PRIMARY KEY REFERENCES
> GROUP_CONCLUSION(GROUP_CONCLUSION_ID)
> >     DO: ) Type=InnoDB;
> >     DO:
> >     DO: where I want to create table with 2 primary keys, but it won't let
> me.
> >     DO:
> >     DO: How could I do it.
> >     DO:
> >     DO: Regards,
> >     DO:
> >     DO: Oganes Demirchyan
> >     DO: Motorola Life Science
> >     DO: 757 S.Raymond
> >     DO: Pasadena, CA  91105
> >     DO: Tel: 626-584-5900
> >     DO: email: [EMAIL PROTECTED]
> >     DO:
> >     DO:
> >
> 
>    DO: ---------------------------------------------------------------------
> >     DO: Before posting, please check:
> >     DO:    http://www.mysql.com/manual.php   (the manual)
> >     DO:    http://lists.mysql.com/           (the list archive)
> >     DO:
> >     DO: To request this thread, e-mail <[EMAIL PROTECTED]>
> >     DO: To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> >     DO: Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> >     DO:
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
> 
> ---------------------------------------------------------------------
> 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