Search Postgresql Archives

Re: Using the REPLACE command to replace all vowels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 May 2006 13:16:15 -0700, EbGrooveCb <cbaumann@xxxxxxxxxx> 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','')
;


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux