Home » SQL & PL/SQL » SQL & PL/SQL » no value
no value [message #1700] Thu, 23 May 2002 13:03 Go to next message
lerone streeter
Messages: 2
Registered: May 2002
Junior Member
i'm trying to do a select, the colums in my where clause are a date and numeric. i want to see all records where no value is entered in the date or numeric field. i've tried coverting them using to_char and comparing against ' ' but it doesn't return results. if i say <> ' ' i get results. what must i use to represent blank?

select f1, f2, f3 from table where f9=' ' and f10=' ';

select f1, f2, f3 from table where to_char(f9)=' ' and to_char(f10)=' ';
Re: no value [message #1701 is a reply to message #1700] Thu, 23 May 2002 13:08 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
use NULL.
**********************************

1 select * from emp where comm is null
2* and mgr is null
SQL> /

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7839 KING PRESIDENT 23-MAY-02 5000 10
Re: no value [message #1703 is a reply to message #1700] Thu, 23 May 2002 13:25 Go to previous messageGo to next message
Robert Kuhlmann
Messages: 35
Registered: March 2002
Member
try it wit the is null keyword in the where clause

select f1, f2, f3 from table where f9 is null or f10 is null;
Re: no value [message #1727 is a reply to message #1703] Fri, 24 May 2002 05:55 Go to previous message
lerone streeter
Messages: 2
Registered: May 2002
Junior Member
bingo!
Previous Topic: Re: UTL_FILE.FOPEN - opening a file size > 50k
Next Topic: Check Constraints
Goto Forum:
  


Current Time: Fri Apr 26 19:02:11 CDT 2024