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



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to