Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 3B66B9FB1E6; Mon, 25 Jun 2007 15:07:27 -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 42691-02; Mon, 25 Jun 2007 15:07:21 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by postgresql.org (Postfix) with ESMTP id 9FB999FB77D; Mon, 25 Jun 2007 15:07:22 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis), id 0ML25U-1I2sy60Msq-0006PF; Mon, 25 Jun 2007 20:07:18 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1I2sy5-0005AY-00; Mon, 25 Jun 2007 20:07:17 +0200 Date: Mon, 25 Jun 2007 20:07:17 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org, pgsql-novice@postgresql.org Subject: Re: [SQL] yet another simple SQL question Message-ID: <20070625180717.GA19814@a-kretschmer.de> References: <467FFEF9.5050603@joshuaneil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <467FFEF9.5050603@joshuaneil.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX1+e6sl8mOdjwW7507CrwtNp/XeIL253D43/Wj6 Vw/EV0po29fMGosQ7EMRwqTi8UjQ2PaYzhtk8mD7jNHXvwZChC lIUR2dqRa8SKeG4J9OcbHfy4iMV70kb X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/173 X-Sequence-Number: 19071 am Mon, dem 25.06.2007, um 12:44:25 -0500 mailte Joshua folgendes: > 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 Yes, of course: test=# select split_part('My Name', ' ', 1); split_part ------------ My (1 row) And now, i think, you should read our fine manual: http://www.postgresql.org/docs/current/interactive/ Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net