oracle - Case expressions and boolean -


please explain, why first 1 works , others return errors.

  1. returns 'blue':

    select case when 'a' = 'a' 'blue' end dual;

  2. error: ora-00920: invalid relational operator

    select case when true 'blue' end dual;

  3. ora-00904: "true": invalid identifier

    select case when 'a' = 'a' true end dual;

  4. ora-00905: missing keyword

    select case when 'b' = 'b' 'a' = 'a' end dual;

there no real boolean sql type in oracle sql. neither true or false constants. boolean represented single characters 'y' or 'n' or numbers 0 or 1.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -