Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Query Clarification.
<cybotto_at_yahoo.com> a écrit dans le message de news: 1130653256.986100.151560_at_g43g2000cwa.googlegroups.com...
|
| Comparing NULL = NULL, NULL <> NULL, NULL > NULL, etc. will always
| result in false ...
|
This is not true, these conditions return UNKNOWN and not FALSE. Oracle works on a trivalue logic.
SQL> begin
2 if '' = '' then dbms_output.put_line('equal is TRUE');
3 elsif not ('' = '') then dbms_output.put_line('equal is FALSE');
4 else dbms_output.put_line('equal is NEITHER true nor false');
5 end if;
6 end;
7 /
equal is NEITHER true nor false
PL/SQL procedure successfully completed.
A select returns rows that returns TRUE for the where clause. All rows that return FALSE or UNKNOWN are discarded. This is a litlle confusing but logic.
Regards
Michel Cadot
Received on Sun Oct 30 2005 - 01:43:40 CDT
![]() |
![]() |