what about:

CREATE UNIQUE INDEX id ON thistable (APPCODE, EMAILID);

regards,

rene


----- Original Message ----- 
From: "Duke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 20, 2001 4:02 PM
Subject: Wats the CREATE TABLE statement?


I would like to know how to write a SQL statement if i have a composite key
present in the table. eg. my table is

APPCODE EMAILID EMAIL
1 ML1 [EMAIL PROTECTED]
1 ML2 [EMAIL PROTECTED]
2 ML1 [EMAIL PROTECTED]
3 ML1 [EMAIL PROTECTED]
4 ML1 [EMAIL PROTECTED]
4 ML2 [EMAIL PROTECTED]


as you can see in the above table ..... emailids per appcode is maximum 2.,
hence each appcode will repeat. 
Also the combination of APPCODE+EMAILID helps to identify a given row
uniquely. ie. APPCODE + EMAILID are a combined primary key.

but i havent able to figure out how to go bout writing the SQL code.

does any1 know what the SQL CREATE TABLE statement will be?


Website: http://www.ilug-bom.org.in/
Ftp site: ftp.ilug-bom.org.in
Chat: irc.ilug-bom.org.in
Linuxers mailing list: [EMAIL PROTECTED]
http://ilug-bom.org.in/mailman/listinfo/linuxers


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

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

Reply via email to