Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: diff. between Primary-Key and unique index
Hi
Well, Jan-Erik is right. The difference between primary key and unique
key
is that unique key can be null (and NOT only once, but you can insert
rows with as many null values as you want ). You can also change a
unique index to "Primary key" (without PK-constraint) defining the
column as NOT NULL.
rgrds Kari Pannila
DBA - OCP
Tapan Trivedi wrote:
>
> WOW!
>
> Jan-Erik Rosinowski wrote:
>
> > >if a column is declared as a unique key it will allow null
> > >value in that column (but only once) since the column is unique and
> > >therefore null values can occur but only once
> >
> > from my point of understanding 'null' is similar to infinity in
> > mathematics. nothing can be equal to infty. for that very reason null
> > IS null but (null=null) IS null..
> >
> > so i don't understand how null can be really unique or why on the
> > other hand, null isn't allowed in a pk (w/ the same semantics)
> >
> > anybody any further insights?
> >
> > ciao, jan
> >
> > http://www.rsp.de - Software zur effizienten Erstellung und Verwaltung von
> > Gutachten, Analysen, Pruefprotokollen etc.
Received on Mon Jan 24 2000 - 14:22:19 CST
![]() |
![]() |