Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2003
    Location
    Hong kong
    Posts
    14

    Unanswered: Check Empty Field

    Dear all,

    I find the syntax is wrong in the following statement. Please help.

    select * from table1 where rtrim(num) contains ''


    Is it correct? I want to return the records with the empty field of num in table1 .

    Please help!!!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    "Empty" or NULL?
    There is a difference, you know.

  3. #3
    Join Date
    Nov 2003
    Location
    Hong kong
    Posts
    14
    Originally posted by anacedent
    "Empty" or NULL?
    There is a difference, you know.

  4. #4
    Join Date
    Nov 2003
    Location
    Hong kong
    Posts
    14

    Null or Empty

    Dear ,

    If null, what it should be?

    If empty, then what should be the statement?

    Originally posted by anacedent
    "Empty" or NULL?
    There is a difference, you know.

  5. #5
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    select * from table where column is null

    select * from table where column is not null

    Hth
    Bill
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

  6. #6
    Join Date
    Nov 2003
    Location
    Bangalore, INDIA
    Posts
    333

    Thumbs up Re: Check Empty Field

    HI,

    select * from table1 where num IS NULL;



    Originally posted by rchiu2
    Dear all,

    I find the syntax is wrong in the following statement. Please help.

    select * from table1 where rtrim(num) contains ''


    Is it correct? I want to return the records with the empty field of num in table1 .

    Please help!!!
    SATHISH .

  7. #7
    Join Date
    Dec 2003
    Location
    Noida, India.
    Posts
    171

    Re: Null or Empty

    To query null records:
    select * from table where column is null;

    To query records with empty values:
    select * from table where column ='';

    To query records with only spaces :
    select * from table where trim(column) ='';





    Originally posted by rchiu2
    Dear ,

    If null, what it should be?

    If empty, then what should be the statement?
    Oracle can do wonders !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •