Showing counts for distinct results
Brought to you by:
jhereth,
peterbecker
When enlisting a distinct result set, it would be useful to
somehow get the information how many objects are
having each value, e.g. by putting the number in
parentheses behind the value itself.
If the query is:
SELECT DISTINCT column1, column2 FROM table
WHERE someClause;
and one result is:
value1, value2
the number should be:
SELECT count(*) FROM table WHERE someClause
AND (column1 = value1) AND (column2 = value2);