Connecting Tech Pros Worldwide Forums | Help | Site Map

Create UNIQUE KEY

Newbie
 
Join Date: Jun 2006
Posts: 12
#1: Sep 15 '06
hello
can anyone tell me how to create a table with 3 columns as UNIQUE KEY

PraDz

Member
 
Join Date: Aug 2006
Posts: 60
#2: Sep 19 '06

re: Create UNIQUE KEY


hi

Try this

CREATE TABLE test1
(
id int4 NOT NULL,
field1 int4,
field2 int4,
field3 int4,
CONSTRAINT idpkey PRIMARY KEY (id),
CONSTRAINT field1unique1 UNIQUE (field1),
CONSTRAINT fieldunique2 UNIQUE (field2),
CONSTRAINT fieldunique3 UNIQUE (field3)
)


-somaskarthic



Quote:

Originally Posted by pradheepayyanar

hello
can anyone tell me how to create a table with 3 columns as UNIQUE KEY

PraDz

Reply