Using nvl within a sum [message #570960] |
Mon, 19 November 2012 05:49  |
 |
SteveShephard
Messages: 41 Registered: August 2012
|
Member |
|
|
Hi guys,
I have a very simple sum within a select statement
select (PERCENTAGE*10) from MYTABLE
I was hoping to add a NVL to this but seem to be running into problems (below - invalid number of arguments)
select nvl(PERCENTAGE*10 'X')from IC_SS_PRICE_CHANGE_IMPORT_TAB
Is something like this possible?
Many thanks guys
Steve
|
|
|
|
Re: Using nvl within a sum [message #570966 is a reply to message #570960] |
Mon, 19 November 2012 06:11   |
 |
Michel Cadot
Messages: 68765 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote: but seem to be running into problems
Sure, you have a syntax error, a comma is missing.
If you use SQL*Plus, it will tell you where it is missing.
And note that the 2 arguments of NVL should be of the same datatype (how do you sum 10 and X?).
And note that the aggregate functions ignore NULLs.
Regards
Michel
[Updated on: Mon, 19 November 2012 06:17] Report message to a moderator
|
|
|
|