Monday, May 21, 2012

SQL Query - How to remove null and replace with blank

Here is my query:



SELECT ename, sal, comm
FROM EMP
WHERE comm IS NULL
ORDER BY sal DESC;


I would like to replace the NULL result in the comm column with a blank space. I have been told to under SELECT, write NULL(comm,' '), however this comes up with an error, saying invalid number. The query works if I have NULL(comm, 0), returning with 0 in the column.



From my understanding this means I can only have a number value in this column, however I want the blank space. Is someone able to please give me some guidance?





No comments:

Post a Comment