Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id B48F09FBE43 for ; Thu, 21 Jun 2007 07:50:51 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 15339-07 for ; Thu, 21 Jun 2007 07:50:43 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by postgresql.org (Postfix) with ESMTP id A89C49FB60F for ; Thu, 21 Jun 2007 07:50:47 -0300 (ADT) Received: from [194.25.154.138] (helo=webserv.wug.de) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis), id 0MKwtQ-1I1KFS1Inp-0003Od; Thu, 21 Jun 2007 12:50:46 +0200 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1I1KFR-00032N-00 for pgsql-sql@postgresql.org; Thu, 21 Jun 2007 12:50:45 +0200 Date: Thu, 21 Jun 2007 12:50:45 +0200 From: "A. Kretschmer" To: pgsql-sql@postgresql.org Subject: Re: Results per letter query Message-ID: <20070621105045.GJ1405@a-kretschmer.de> References: <467A406A.3060907@androme.es> <20070621100425.GH1405@a-kretschmer.de> <467A562C.2020504@androme.es> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <467A562C.2020504@androme.es> 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+8ZCa4JooyT8diagyG5a0OaMN/DNMlSIbQwp5 MmBc5ZSz+xlGqv0ot2Z0U8P9nVaFUVAyudCFCxRe+JgmqgDRll 2gDnon9T7fjscZb1k6IIcBQGoEfshQU X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/159 X-Sequence-Number: 28649 am Thu, dem 21.06.2007, um 12:42:52 +0200 mailte Dani Castaņos folgendes: > >test=*# select chr(x), count(1) from generate_series(65,90) x, w where > >upper(substring (w.t from 1 for 1)) ~ chr(x) group by 1; > > chr | count > >-----+------- > > T | 1 > > B | 1 > > F | 2 > >(3 rows) > > > > > > > >Andreas > > > It's exactly what i want. Just one more thing... What if i want also the > ones that begin by a non-alphabetical character. > In your example: change the generate_series(65,90) to generate_series(32,90) Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net