Re: Using the REPLACE command to replace all vowels

From: "Tony Wasson" <ajwasson(at)gmail(dot)com>
To: EbGrooveCb <cbaumann(at)cmsgrp(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Using the REPLACE command to replace all vowels
Date: 2006-05-02 23:54:07
Message-ID: 6d8daee30605021654u1aadcdadnc6e96a4958b6498f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1 May 2006 13:16:15 -0700, EbGrooveCb <cbaumann(at)cmsgrp(dot)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','')
;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Fernan Aguero 2006-05-02 23:58:16 Re: For vim users: Syntax highlighting for PostgreSQL
Previous Message Tom Lane 2006-05-02 22:30:50 Re: age(datfrozenxid) negative for template0. Is this normal?