Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id BBD9A9FB4F3 for ; Tue, 8 May 2007 09:59:05 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97961-08 for ; Tue, 8 May 2007 09:59:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.188]) by postgresql.org (Postfix) with ESMTP id 95DB29FB52E for ; Tue, 8 May 2007 09:58:59 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu6) with ESMTP (Nemesis), id 0ML29c-1HlPHL0rp1-0002fZ; Tue, 08 May 2007 14:58:55 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1HlPHK-00007q-00 for pgsql-sql@postgresql.org; Tue, 08 May 2007 14:58:54 +0200 Date: Tue, 8 May 2007 14:58:54 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Needs Query Message-ID: <20070508125854.GE19006@a-kretschmer.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/0xuPyLEfoMkXrTwZlZ5UpTqwljuS2caJGUII /qdYLTWJbbB9kLvWRpBoeq8gqCn4rPUQXhSaps/rjQsQDPsYwR ldJdRYkP7Gy2Lw/zYsFqEeU/enVlTam X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/59 X-Sequence-Number: 28340 am Tue, dem 08.05.2007, um 17:48:47 +0530 mailte Penchalaiah P. folgendes: > > > > > > > > > In a table, a column contains > > > > Suneelllllllllllllll > > Sudhakarrrrrrrrrr > > Vivekkkkkkkkkk > > Ramanaaaaaaaaa > > > > > > But my output is > > Suneel > > Sudhakar > > Vivek > > Ramana > > I want a query to get my output like above??.. write a stored proc. within this proc: (oversimplified) - calculate the length of the string with length() -> length - extract substring(string, length, length) -> last_char - regexp_replace(string, last_char||'*$', last_char) Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net