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!

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to