Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to set a field primary key in a pre existing table

bootstrapDec 5 2009 — edited Dec 5 2009
Hi,
Suppose i have a table and no field in it is a primary key like this

create table t1
(a number not null,
b number);


Later i want to make a as primary key then how to do that?

I tried with this statement but it gave error

alter table t1
modify a primary key;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 2 2010
Added on Dec 5 2009
3 comments
614 views