Re: count(*) vs count(id)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: count(*) vs count(id)
Дата
Msg-id 3502043.1612226098@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: count(*) vs count(id)  (Matt Zagrabelny <mzagrabe@d.umn.edu>)
Ответы Re: count(*) vs count(id)  (Matt Zagrabelny <mzagrabe@d.umn.edu>)
Список pgsql-general
Matt Zagrabelny <mzagrabe@d.umn.edu> writes:
> On Mon, Feb 1, 2021 at 5:57 PM Rob Sargent <robjsargent@gmail.com> wrote:
>> You got one null from count(*) likely.

> What is count(*) counting then? I thought it was rows.

Yeah, but count(id) only counts rows where id isn't null.

            regards, tom lane



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

Предыдущее
От: Matt Zagrabelny
Дата:
Сообщение: Re: count(*) vs count(id)
Следующее
От: Matt Zagrabelny
Дата:
Сообщение: Re: count(*) vs count(id)