[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1105
  • Last Modified:

SQL remove middle space

I have a situation where I get the following output

select date from dual;
OUTPUT
september2004,
august2004,
september     2004,-----middle space
august    2004-----------middle space

I need the output without middle space

Required output

september2004,
august2004,
september2004,--- without middle space
august2004-------without middle space

Thanks
Srini
0
srpendyala
Asked:
srpendyala
  • 2
2 Solutions
 
slightwv (䄆 Netminder) Commented:
A simple replace should work:
select replace('hello      world',' ','') from dual;
0
 
akmustafaCommented:

You can use
select to_char(date,'fmMonth')||to_char(date,'yyyy') from dual
0
 
akmustafaCommented:
You can also use in just one 'to_char' function

select to_char(date,'fmmonthyyyy') from dual


in format mask 'fm' excludes spaces.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now