This looks like the Oracle SQl Developer, so I assume your database engine is some version of Oracle. That being the case, if you were to check the entry for NVL in the Oracle Docs, you would learn:
Quote
The arguments expr1 and expr2 can have any datatype. If their datatypes are different, then Oracle Database implicitly converts one to the other. If they are cannot be converted implicitly, the database returns an error. The implicit conversion is implemented as follows:
If expr1 is character data, then Oracle Database converts expr2 to the datatype of expr1 before comparing them and returns VARCHAR2 in the character set of expr1.
If expr1 is numeric, then Oracle determines which argument has the highest numeric precedence, implicitly converts the other argument to that datatype, and returns that datatype.
So basically Oracle wants to convert 'none' to a numeric datatype since the first argument for NVL is a numeric type. 'none' can't be parsed as a number so you get the behavior you are seeing. One workaround would be to cast manager id as a char, so that your first argument is a char, which is compatible with the value 'none'
I don't have an Oracle installation handy to test, but essentially this is what you are looking for:
Code
SELECT department_id, department_name, NVL(TO_CHAR(manager_id), 'NONE') AS manager_id, location_id
FROM departments
This post was edited by choombawoomba on Feb 16 2013 06:55pm