Results per letter query - Mailing list pgsql-sql

From Dani Castaños
Subject Results per letter query
Date
Msg-id 467A406A.3060907@androme.es
Whole thread Raw
Responses Re: Results per letter query
List pgsql-sql
Hi!

I'm trying to build a query to get if there is an occurrence for a field 
for each alphabetical letter.
My first thought to know it was to do something like:

SELECT COUNT(field) FROM table WHERE UPPER( field )  LIKE UPPER( 'A%' ) 
LIMIT 1;
SELECT COUNT(field) FROM table WHERE UPPER( field )  LIKE UPPER( 'B%' ) 
LIMIT 1;
SELECT COUNT(field) FROM table WHERE UPPER( field )  LIKE UPPER( 'C%' ) 
LIMIT 1;
...
and so on...

Is there any way to do it in only one query??

Thank you in advance!


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Select last there dates
Next
From: "A. Kretschmer"
Date:
Subject: Re: Select last there dates