This content has been marked as final. Show 3 replies
you have to write as :
select '10% Salary plus 100 ' || (1000*10/100+100) from dual;
It is about operator precedence.
The * and / operators are evaluated first (from left to right).
Then + and || are evaluated second (from left to right).
The second step causes the problem.
The first query performs + then || which is OK. The second performs || then +, which is not (since the result of the concatenation is not a number).
Thanks Manik.. I did try that and it works.. I'd deliberately avoided parantheses as it overrides the operator precedence that i was testing..