Home » RDBMS Server » Server Administration » unique constraint
unique constraint [message #373701] Wed, 02 May 2001 07:23 Go to next message
adelia
Messages: 45
Registered: April 2001
Member
Why I use a unique constraint instead of using Primary key constraint , to create a table ???
Re: unique constraint [message #373703 is a reply to message #373701] Wed, 02 May 2001 07:35 Go to previous messageGo to next message
siddharth
Messages: 16
Registered: May 2001
Junior Member
The diffrence between a unique constraint and a primary key constraint is that unique constraint allows a null value in one row of the table if null is allowed for that column.
A column with primary key cannot contain a null value.

HTH
Siddharth
Re: unique constraint [message #373708 is a reply to message #373703] Wed, 02 May 2001 08:25 Go to previous messageGo to next message
jayaram
Messages: 9
Registered: May 2001
Junior Member
Its not just one row with null column, you can have many rows with null column when , unique constraint is assigned to column.
no two nulls are same, NUll <> NULL( <> - not equal to)
Re: unique constraint [message #373709 is a reply to message #373703] Wed, 02 May 2001 08:26 Go to previous messageGo to next message
jayaram
Messages: 9
Registered: May 2001
Junior Member
Its not just one row with null column, you can have many rows with null column when , unique constraint is assigned to column.
Two nulls in a column are not same, NUll <> NULL( <> - not equal to)
Re: unique constraint [message #374147 is a reply to message #373703] Mon, 28 May 2001 07:40 Go to previous messageGo to next message
adelia
Messages: 45
Registered: April 2001
Member
Two nulls in a column are not same ????
Re: unique constraint [message #374244 is a reply to message #373703] Fri, 01 June 2001 07:24 Go to previous message
adelia
Messages: 45
Registered: April 2001
Member
Two nulls in a column are not same ???? Why ??
Previous Topic: Can we avoid using the (+) keyword in a outer join
Next Topic: Minus with Order by
Goto Forum:
  


Current Time: Mon Dec 23 13:17:53 CST 2024