Replace spaces, tabs and carriage returns
oracle, replace, select, sql
Solution
In Oracle if you just want to remove a character you can omit the third argument of the replace call and the function for character codes is chr(), not char().
So your line would be `SELECT ... replace(rs.notes,chr(10)) ...`
Problem
I am working with SQL developer with Oracle 11g. I have a query that looks something along the lines of this; ``` SELECT [column], [column], [column],...... rs.notes FROM [table], [table], [table]............ return_sku rs WHERE [conditions] AND [conditions] AND [conditions] ``` In the `return_sku` column there are tabs, spaces, and newlines (I believe this is a carriage return?) I need to make all of these spaces, carriage returns and tabs disappear when I run my query. I am fairly new to SQL, but the most popular search result I found is the REPLACE function. I have absolutely no idea how to use this, as I've tried this in many different ways with no result. I've tried the following; ``` SELECT [column], [column], [column],...... REPLACE(rs.notes, Char(10), '') FROM [table], [table], [table]............ return_sku rs WHERE [conditions] AND [conditions] AND [conditions] ``` This gives the error message: ``` ORA-00904: "RS"."NOTES": invalid identifier 00904. 00000 - "%s: invalid identifier" *Cause: *Action: Error at Line: 3 Column: 531 ``` How do I use this function correctly?