Skip site navigation (1) Skip section navigation (2)

Re: need a query

From: Ognjen Blagojevic <ognjen(at)etf(dot)bg(dot)ac(dot)rs>
To: 'AI Rumman' <rummandba(at)gmail(dot)com>
Cc: 'pgsql-general General' <pgsql-general(at)postgresql(dot)org>
Subject: Re: need a query
Date: 2010-03-29 10:06:14
Message-ID: 4BB07B96.2050102@etf.bg.ac.rs (view raw or flat)
Thread:
Lists: pgsql-general
If you are sure that your words are space delimited, you may use this:

select regexp_replace('Ispahani Public School'||' ', '([^ ])([^ ]* )', 
'\\1', 'g');

Regards,
Ognjen


Timo Klecker wrote:
> Try this:
> 
> SELECT regexp_matches('foobar beque bazil barf bonk', '(\\m.)', 'g')
> 
> Now you have the first letters, you can use array_to_string to get an 
> string and use concat_str after this:
> 
> http://stackoverflow.com/questions/43870/how-to-concatenate-strings-of-a-string-field-in-a-postgresql-group-by-query
> 
>  
> 
>  
> 
>  
> 
>  
> 
> Mit freundlichen Grüßen
> 
> Timo Klecker
> 
> * *
> 
> * *
> 
>  
> 
> *Von:* pgsql-general-owner(at)postgresql(dot)org 
> [mailto:pgsql-general-owner(at)postgresql(dot)org] *Im Auftrag von *AI Rumman
> *Gesendet:* Montag, 29. März 2010 10:45
> *An:* pgsql-general General
> *Betreff:* [GENERAL] need a query
> 
>  
> 
> I need a query to get the initial letter of the words:
> Like:
> 
> Ispahani Public School -------- IPS
> Ahmed Iftekhar -------- AI
> 
> Any help please.
> 


In response to

pgsql-general by date

Next:From: Armand TurpelDate: 2010-03-29 10:32:25
Subject: one null value in array isnt allowed???
Previous:From: Timo KleckerDate: 2010-03-29 09:30:17
Subject: Re: need a query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group