Saturday, November 7, 2015

Oracle SQL: SELECT (Arithmetic Expressions)


                       
Operator
Description
+
 Add
-
 Subtract
*
 Multiply
/
 Divide
  

Using Arithmetic Operators: 
SELECT customer_name,unit, price, price+ 300 FROM  customers;

Operator Precedence
If an arithmetic expression contains more than one operator, multiplication and division are evaluated first. If operators in an expression are of the same priority, then evaluation is done from left to right. You can use parentheses to force the expression that is enclosed by parentheses to be evaluated first.

Rules of Precedence:
1. Multiplication and division occur before addition and subtraction.
2. Operators of the same priority are evaluated from left to right.
3. Parentheses are used to override the default precedence or to clarify the statement.

                                            <<Back                           Next>>

No comments:

Post a Comment