can we create a primary key on duplicate column?

Q.> can we create a primary key on duplicate column?
Ans: Yes
Below are the examples

select * from ZZ_EMP
/
select * from user_cons_columns
where table_name='EMP1'
/
select * from user_indexes
where table_name='ZZ_EMP'
/
select * from user_constraints
where table_name='ZZ_EMP'
/
create index id1_eno on zz_emp(empno)
/
alter table ZZ_EMP add constraint c_pk_zzeno primary key(empno) enable novalidate

No comments:

Post a Comment

Session Clear

 Select 'alter system kill session '''|| sid_serial#||''''||chr(010)||'/' from locked_objects_info_v...