Shaun Thomas <stho...@peak6.com> wrote:
 
> You're counting the number of maximum values in your table for
> tds_cx_ind and cxs_ind_2, but there will always be at least one
> for every combination.
 
Good point.
 
> What you really want is this:
> 
> SELECT count(1) FROM (
>    SELECT DISTINCT tds_cx_ind, cxs_ind_2
>      FROM max_xtrv_st_t
> );
 
Or maybe:
 
SELECT count(DISTINCT (tds_cx_ind, cxs_ind_2)) FROM max_xtrv_st_t;
 
-Kevin

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Reply via email to