Home » SQL & PL/SQL » SQL & PL/SQL » Trim Spaces in a Select
Trim Spaces in a Select [message #8181] Fri, 01 August 2003 15:47 Go to next message
Ted
Messages: 9
Registered: June 2002
Junior Member
Hi,

I have values in a column that I need to trim spaces from.

There is a table with a cloumn called "type" some values in this column are "New Buy", "Old Action Request" etc.

What I need to do is select those vlaues out but have them displayed in the folowing format:

NewBuy
OldActionRequest
No spaces between the words. Is there an SQL funtion that will eliminate the space?
Re: Trim Spaces in a Select [message #8182 is a reply to message #8181] Fri, 01 August 2003 15:52 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
replace(type, ' ')


The third parameter to the function (not specified above since we are just removing, not replacing) indicates what character(s) should substitute.

sql>select replace('Old Action Request', ' ') from dual;
 
REPLACE('OLDACTI
----------------
OldActionRequest
Previous Topic: Where Clause
Next Topic: Connect by & rollup information
Goto Forum:
  


Current Time: Thu May 09 02:58:13 CDT 2024