操作员 | 手术 |
---|---|
** | 取幂 |
+, - | 身份,否定 |
*, / | 乘法、除法 |
+, -, || | 加法、减法、串联 |
比较 | |
NOT | 逻辑否定 |
AND | 连词 |
OR | 包容 |
DECLARE
a number(2) := 20;
b number(2) := 10;
c number(2) := 15;
d number(2) := 5;
e number(2) ;
BEGIN
e := (a + b) * c / d; -- ( 30 * 15 ) / 5
dbms_output.put_line('Value of (a + b) * c / d is : '|| e );
e := ((a + b) * c) / d; -- (30 * 15 ) / 5
dbms_output.put_line('Value of ((a + b) * c) / d is : ' || e );
e := (a + b) * (c / d); -- (30) * (15/5)
dbms_output.put_line('Value of (a + b) * (c / d) is : '|| e );
e := a + (b * c) / d; -- 20 + (150/5)
dbms_output.put_line('Value of a + (b * c) / d is : ' || e );
END;
/
Value of (a + b) * c / d is : 90
Value of ((a + b) * c) / d is : 90
Value of (a + b) * (c / d) is : 90
Value of a + (b * c) / d is : 50
PL/SQL procedure successfully completed.