Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL remove middle space

Posted on 2004-10-27
5
Medium Priority
?
1,090 Views
Last Modified: 2008-01-09
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
Comment
Question by:srpendyala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 12422778
A simple replace should work:
select replace('hello      world',' ','') from dual;
0
 

Assisted Solution

by:akmustafa
akmustafa earned 500 total points
ID: 12425227

You can use
select to_char(date,'fmMonth')||to_char(date,'yyyy') from dual
0
 

Expert Comment

by:akmustafa
ID: 12425287
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question