Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id DE35B9FC093 for ; Thu, 21 Jun 2007 07:59:11 -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 78033-09 for ; Thu, 21 Jun 2007 07:59:08 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id CDF309FB97B for ; Thu, 21 Jun 2007 07:59:07 -0300 (ADT) Received: by fafnir.androme.com (Postfix, from userid 1003) id 7E48DB93C95; Thu, 21 Jun 2007 12:59:06 +0200 (CEST) Message-ID: <467A59F9.4030801@androme.es> Date: Thu, 21 Jun 2007 12:59:05 +0200 From: =?ISO-8859-1?Q?Dani_Casta=F1os?= User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Results per letter query References: <467A406A.3060907@androme.es> <20070621100425.GH1405@a-kretschmer.de> <467A562C.2020504@androme.es> <20070621105045.GJ1405@a-kretschmer.de> In-Reply-To: <20070621105045.GJ1405@a-kretschmer.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/160 X-Sequence-Number: 28650 > 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 > With only changing 65 to 32: ERROR: invalid regular expression: parentheses () not balanced I think, it could be a problem with UPPER and non alphabetical chars -- *Dani Castaños Sánchez* dcastanos@androme.es ANDROME Iberica http://www.androme.es Constança, 5, 08029 Barcelona Tel: +34 934948850 Fax: +34 934196094