Re: yet another simple SQL question

Поиск
Список
Период
Сортировка
От Ragnar
Тема Re: yet another simple SQL question
Дата
Msg-id 1182796394.5953.294.camel@localhost.localdomain
обсуждение исходный текст
Ответ на yet another simple SQL question  (Joshua <joshua@joshuaneil.com>)
Список pgsql-sql
On mán, 2007-06-25 at 12:44 -0500, Joshua wrote:
> I have a column that looks like this
> 
> firstname
> -----------------
> John B
> Mark A
> Jennifer D
> 
> Basically I have the first name followed by a middle initial. Is there a 
> quick command I can run to strip the middle initial?

how about:
 select regexp_replace(firstname,' .*','') as firstname  from footable;

or:
 select substring(firstname FROM '(.*) ') as firstname  from footable;


gnari




В списке pgsql-sql по дате отправления: