Monday, 22 October 2012

UNARY OPERATORS




We can perform unary operations on numerical expressions only.

  • Positive “+”
  • Negative “-“
  • Bitwise NOT “~”

Positive “+”: Numeric value is positive.
Example: SELECT +350


Negative “-”: Numeric value is negative.
Example: SELECT -350


Bitwise NOT “~”: Returns the ones complement of the number.
Example:
SELECT ~(350)
SELECT ~(-350)



No comments:

Post a Comment