Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Primary key with more than one column
A copy of this was sent to "S,Erik" <e_at_technologist.com>
(if that email address didn't require changing)
On Sat, 27 Jun 1998 13:36:30 -0400, you wrote:
>Can someone please give me the CREATE TABLE syntax for creating a primary
>key that includes more than one column? I have no trouble creating a
>primary key with just one column, but the Oracle7 SQL documentation does not
>give an example including multiple columns.
>
>
create table foo
( x int,
y int,
z varchar2(200),
constraint foo_pk primary key(x,y)
)
/
See the SQL Reference Manual, "Constraints" for examples of table level, versus column level, constraints.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Jun 29 1998 - 09:08:27 CDT