What is the result, when NULL is compared with NULL?
Answers were Sorted based on User's Feedback
Answer / ashu_deepu
2 NULL value can not b equal.
i just want to remind some imp. point about primary key.
d condition is
1) not null n
2) unique.
since 2 null value r unique dats why we require the 1st point of not null.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / nhajare
Hi,
If you comapare null=null then it return 0 rows selected.
Check the result of this query...
select * from table_name where null=null;
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sandeep kumar
select * from dual where null=null
no row return
| Is This Answer Correct ? | 1 Yes | 0 No |
Decode will return true if we compare null to null value.
select decode(commission_pct,null,0) from employees
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / divi
Null is not equal to Null
Nor
Null is equal to Null
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sureka
set serveroutput on;
DECLARE
D INTEGER :=NULL;
E INTEGER :=NULL;
BEGIN
IF (D = E) THEN
dbms_output.put_line('PASS');
ELSIF (D <> E) THEN
dbms_output.put_line('FAIL');
ELSE
dbms_output.put_line('NA');
END IF;
END;
will return NA
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / archana
begin
if null is null then
dbms_output.put_line('null');
else
dbms_output.put_line('not null');
end if
end;
now it will return null
it is recommended to use 'is' with null not ' ='
| Is This Answer Correct ? | 0 Yes | 0 No |
DECLARE
v1 NUMBER;
v2 NUMBER;
BEGIN
IF v1 = v2
THEN
DBMS_OUTPUT.put_line ('Null comapred successfully');
ELSE
DBMS_OUTPUT.put_line ('oops u have to use ISNULL opeartor');
END IF;
END;
output : oops u have to use ISNULL opeartor
| Is This Answer Correct ? | 0 Yes | 0 No |
Which language is used in sql?
How to look at the current sql*plus system settings?
A table has 150 records. How do you retrieve 100th row to 120th row from that table ?
Is pl sql better than sql?
How delete all data from all tables in sql?
Is pl sql still used?
package specification-3 procedures package body-2 procedures will is execute
How many types of keys are there in sql?
Which is better trigger or stored procedure?
what is constraining table?
What is the main reason behind using an index?
How will you a activate/deactivate integrity constraints?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)