Re: count(*) vs count(id)

Поиск
Список
Период
Сортировка
От Matt Zagrabelny
Тема Re: count(*) vs count(id)
Дата
Msg-id CAOLfK3UqHe1urYNhmoT0wp=fx3mniNHaTqjmzJoiFu4jqBQOBw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: count(*) vs count(id)  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgsql-general


On Mon, Feb 1, 2021 at 7:19 PM Guillaume Lelarge <guillaume@lelarge.info> wrote:


You're doing a left join, so I guess there's no row where call_records.timestamp::date = 2020-08-30. That would result with a NULL id.


Thanks for the excellent analysis everyone. I appreciate it!

Here is the documentation (for anyone reading the mailing list in the future...)

count(*) bigintnumber of input rows
count(expression)anybigintnumber of input rows for which the value of expression is not null

Have a great night (or equivalent for your TZ).

-m

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

Предыдущее
От: rob stone
Дата:
Сообщение: Re: libpq and mysterious "invalid byte sequence for encoding UTF8".
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq and mysterious "invalid byte sequence for encoding UTF8".