Tuesday, January 1, 2013

PostgreSQL: Replace multiple spaces with one

If you want to use a single query to replace multiple spaces with one on SQL Server, you can read the articles here http://www.sqlservercentral.com/articles/T-SQL/68378/
However, it's very simple in PostgreSQL by using Regular Expression
SELECT regexp_replace('This    sentence     contains             multiple                 spaces', '\s+', ' ', 'g');

6 comments:

  1. I was wondering if you ever considered changing the layout of your website?

    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with
    it better. Youve got an awful lot of text for only having
    one or 2 images. Maybe you could space it out
    better?

    my weblog; buying a car with bad credit
    Take a look at my web blog - buying a car with bad credit,buy a car with bad credit,how to buy a car with bad credit,buying a car,buy a car,how to buy a car

    ReplyDelete
  2. Do you mind if I quote a couple of your articles as long as I provide credit and sources back
    to your weblog? My blog is in the exact same niche as yours and my visitors would certainly benefit from some of the information
    you provide here. Please let me know if this ok with you.
    Thanks!

    Here is my web site ... buying a car with bad credit

    ReplyDelete
  3. Hello, i think that i noticed you visited my website thus
    i got here to return the want?.I'm attempting to find things to improve my site!I guess its good enough to make use of a few of your ideas!!

    Also visit my page - buying a car with bad Credit

    ReplyDelete
  4. Right away I am going to do my breakfast, afterward having my breakfast coming
    over again to read more news.

    Here is my web-site: how to buy a car with bad credit
    My page > buying a car with bad credit,buy a car with bad credit,how to buy a car with bad credit,buying a car,buy a car,how to buy a car

    ReplyDelete
  5. Write more, thats all I have to say. Literally,
    it seems as though you relied on the video to make your point.
    You clearly know what youre talking about, why throw away your
    intelligence on just posting videos to your site
    when you could be giving us something informative to read?

    Here is my webpage - buying a car with bad credit

    ReplyDelete

Oracle Query