Re: Using the REPLACE command to replace all vowels - Mailing list pgsql-general

From Tony Wasson
Subject Re: Using the REPLACE command to replace all vowels
Date
Msg-id 6d8daee30605021654u1aadcdadnc6e96a4958b6498f@mail.gmail.com
Whole thread Raw
In response to Using the REPLACE command to replace all vowels  ("EbGrooveCb" <cbaumann@cmsgrp.com>)
List pgsql-general
On 1 May 2006 13:16:15 -0700, EbGrooveCb <cbaumann@cmsgrp.com> wrote:
> Is there a way to make seperate replacements in 1 field in one command
> in SQL?
>
> I need to remove all vowels (a,e,i,o,u) in a field. How would I go
> about that?
>

You can do all the replacements in a single SQL statement by nesting
the REPLACE statements. This will just strip those letters.

SELECT
  REPLACE(
  REPLACE(
  REPLACE(
  REPLACE(
  REPLACE(
    'Your string or field here.'
  ,'a','')
  ,'e','')
  ,'i','')
  ,'o','')
  ,'u','')
;

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: age(datfrozenxid) negative for template0. Is this normal?
Next
From: Fernan Aguero
Date:
Subject: Re: For vim users: Syntax highlighting for PostgreSQL