O'Reilly logo

SQL: Visual QuickStart Guide by Chris Fehily

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Performing Arithmetic Operations

A monadic arithmetic operator performs a mathematical operation on a single numeric operand to produce a result. The - (negation) operator changes the sign of its operand, and the not very useful + (identity) operator leaves its operand unchanged. A dyadic arithmetic operator performs a mathematical operation on two numeric operands to produce a result. These operators include the usual ones: + (addition), - (subtraction), * (multiplication), and / (division). Table 5.1 lists SQL’s arithmetic operators (expr is a numeric expression).

To change the sign of a number:

To add, subtract, multiply, or divide:

  • Type expr1 + expr2 to add, expr1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required