Results 1 to 4 of 4

Thread: what will be te value and why?

  1. #1
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    what will be te value and why?

    what will be te value and why?

    NULL*5= ?

    and

    NULL+5= ?

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  2. #2
    Junior Member
    Join Date
    Jan 2008
    Answers
    2

    Smile Re: what will be te value and why?

    When a variable has no value, it considered to be null. Having a null value is different than having a value of 0, since 0 is an actual value. However, when used in a boolean test, both null and zero result in a FALSE value. Programmers often use boolean tests to determine whether a variable has been given a value or not.
    Again...
    In SQL, NULL is not a value. It is a state indicating that an item's value is unknown or nonexistent. It is not zero or blank or an “empty string” and it does not behave like any of these values. Few things in SQL lead to more confusion than NULL, and yet its workings shouldn't be hard to understand as long as you stick to the following simple definition: NULL means unknown.


    NULL*5= NULL

    and

    NULL+5= NULL

    For further reading please follow the link:
    http://firebird.sourceforge.net/manu...l-in-exps.html


  3. #3
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    Re: what will be te value and why?

    The value null can be regarded as an unknown value. Therefore,
    select NULL*5 from dual; AND select NULL+5 from dual; return null value
    This is because five plus an unknown value (5 * unknown value ) is of course unknown , hence Oracle returns null.


  4. #4
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: what will be te value and why?

    Of course in both the instances the result is NULL only.

    Yes, that is the peculearity of NULL.

    because
    NULL <> NULL
    and
    NULL not <> NULL



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact