Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E59E59FB40C for ; Mon, 25 Jun 2007 15:12:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 57859-02 for ; Mon, 25 Jun 2007 15:12:21 -0300 (ADT) X-Greylist: delayed 00:19:29.233236 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 4FCEA9FBA3E for ; Mon, 25 Jun 2007 15:12:21 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from tiggs.net (206-223-169-74.beanfield.net [206.223.169.74]) by svr4.postgresql.org (Postfix) with ESMTP id 582C25AF888 for ; Mon, 25 Jun 2007 17:52:51 +0000 (GMT) Received: from localhost (206-223-169-82.beanfield.net [206.223.169.82]) by tiggs.net (Postfix) with ESMTP id 0CD1727E43E; Mon, 25 Jun 2007 12:52:50 -0500 (CDT) Received: from tiggs.net ([206.223.169.74]) by localhost (mx1.hub.org [206.223.169.82]) (amavisd-new, port 10024) with ESMTP id 92041-06; Mon, 25 Jun 2007 17:52:49 +0000 (UTC) Received: from [10.0.1.202] (unknown [68.187.34.210]) by tiggs.net (Postfix) with ESMTP id 5C0AB27E42C; Mon, 25 Jun 2007 12:52:49 -0500 (CDT) Message-ID: <468000ED.60107@tiggs.net> Date: Mon, 25 Jun 2007 12:52:45 -0500 From: Charley Tiggs User-Agent: Thunderbird 2.0.0.4 (Macintosh/20070604) MIME-Version: 1.0 To: Joshua Cc: pgsql-novice@postgresql.org Subject: Re: yet another simple SQL question References: <467FFEF9.5050603@joshuaneil.com> In-Reply-To: <467FFEF9.5050603@joshuaneil.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/174 X-Sequence-Number: 19072 Most of these commands are available within the online documentation: http://www.postgresql.org/docs/8.2/interactive/functions.html That said, you might try: UPDATE mytable SET firstname = TRIM(SUBSTRING(firstname,1,position(' ' in firstname))); Charley Joshua wrote: > Ok, > > You guys must be getting sick of these newbie questions, but I can't > resist since I am learning a lot from these email lists and getting > results quick! Thanks to everyone for their contributions. > > Here is my questions.... > > 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? Basically, I just > need to delete the middle initial so the column would then look like the > following: > > firstname > --------------- > John > Mark > Jennifer > > Thanks again for all of your help today. Everything you guys have been > sending has produced successful results. > > Thanks. > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq >