Can we use more than one null value for unique key?
Answer Posted / sabariesh thavamani
i worked out the coding in the above using oracle 9 i, but
i could not get the correct answer what he told.. try it
SQL> create table sab(name varchar2(10) unique);
Table created.
SQL> insert into sab values('&sab');
Enter value for sab: null
old 1: insert into sab values('&sab')
new 1: insert into sab values('null')
1 row created.
SQL> /
Enter value for sab: null
old 1: insert into sab values('&sab')
new 1: insert into sab values('null')
insert into sab values('null')
*
ERROR at line 1:
ORA-00001: unique constraint (LPUSER18.SYS_C0038068)
violated
SQL> /
Enter value for sab: sabari
old 1: insert into sab values('&sab')
new 1: insert into sab values('sabari')
1 row created.
SQL> /
Enter value for sab: null
old 1: insert into sab values('&sab')
new 1: insert into sab values('null')
insert into sab values('null')
*
ERROR at line 1:
ORA-00001: unique constraint (LPUSER18.SYS_C0038068)
violated
SQL> select * from sab
2 ;
NAME
----------
null
sabari
try it....
| Is This Answer Correct ? | 5 Yes | 5 No |
Post New Answer View All Answers
What is the use of partition by in sql?
What is nosql example?
What is full join in sql?
How much does sql cost?
what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba
How do I upgrade sql?
What is over () in sql?
explain the difference between bool, tinyint and bit. : Sql dba
How to run sql commands in sql*plus?
what is union, minus and interact commands? : Sql dba
What is a unique key?
Can we join more than 2 tables in sql?
How to write a query to show the details of a student from students table whose
Explain aggregate functions are available there in sql?
What is normalization sql?