Re: Inaccurate results

Поиск
Список
Период
Сортировка
От greg@turnstep.com
Тема Re: Inaccurate results
Дата
Msg-id 987d1f42f68fc193155c71d4dfe1eb2c@biglumber.com
обсуждение исходный текст
Ответ на Inaccurate results  ("Chad Thompson" <chad@weblinkservices.com>)
Список pgsql-novice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


[simplified]
> select count(distinct(full_phone),state
> from lists group by state
> having count(*) > 250000
> ...
> 199121    UT  ***
> ...
> Why would these ( *** ) have showed up in the list?

You are grouping on the *distinct* phones, but running
the HAVING filter on the total counts. Utah has over
250,000 phones, but only 199,121 distinct ones.
In other words, your HAVING clause needs to match your
initial COUNT clause:

having count(distinct(full_phone)


- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200302071417

-----BEGIN PGP SIGNATURE-----
Comment: http://www.turnstep.com/pgp.html

iD8DBQE+RAbLvJuQZxSWSsgRAv8hAKD57KIzlbu3WT7VaWAkwA+W8Y/siACfcKJ5
PnJXEfSM2I3GvJ7Dg9I7sO0=
=VXd4
-----END PGP SIGNATURE-----


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Chad Thompson"
Дата:
Сообщение: Re:
Следующее
От: Andrew McMillan
Дата:
Сообщение: Re: