r_musta <zepolen(at)gmail(dot)com> writes:
> However, this is starting to become too slow (as there are about 10 of
> these queries), and therefore I need to write an aggregate function
> which lets me do:
> SELECT count_unique(make), count_unique(color) from table WHERE >criteria<;
I must be missing something, because I don't see why you couldn't do
SELECT count(distinct make), count(distinct color) from table WHERE >criteria<;
regards, tom lane