Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do you create a double-primary key?

Re: How do you create a double-primary key?

From: <david.archer_at_chase.com>
Date: Tue, 19 Sep 2000 21:01:15 GMT
Message-ID: <8q8k6c$h2b$1@nnrp1.deja.com>

ALTER TABLE ID_PAIRS
ADD CONSTRAINT pk_id_Pairs PRIMARY KEY (id1, id2)

In article <8q7ruq$g9o$1_at_marte.lastminutetour.com>,   "Francesco Marchioni" <Francesco.Marchioni_at_intra.lastminutetour.com> wrote:
> Hello,
> I'd like to know how can I create a table with a double primary key?
> I mean I have two keys
>
> ID1 ID2
>
> and it's legal to have duplicates of ID1 or duplicates of ID2 but not
 of ID1
> and ID2 together.
> Example:
>
> ID1 ID2
> 1 5 Ok
> 1 4 Ok
> 3 4 Ok
> 1 5 Wrong. I don't want to allow this!
>
> Does anybody know how to do it?
> Thanks
> Francesco
>
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Sep 19 2000 - 16:01:15 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US