Re: Extract date portion of a datetime field

Поиск
Список
Период
Сортировка
От Scott Ford
Тема Re: Extract date portion of a datetime field
Дата
Msg-id CAH-vkx57EPOVUKPhJknp653tcqd6i0KWguoy=UCyt6xrv3ALfw@mail.gmail.com
обсуждение исходный текст
Ответ на Extract date portion of a datetime field  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-novice
I've used something like this in the past:

SELECT COUNT(p.index_value)
, p.create_datetime::date
FROM people p
GROUP BY p.create_datetime::date

Simple, but it works.

Scott

On Wed, Apr 18, 2018 at 10:01 AM JORGE MALDONADO <jorgemal1960@gmail.com> wrote:
Hello,

I have a table with a datetime field which saves (of course) date and time information. I need to design a query to count the number of records of each date without taking into account the time portion. I have seen that I can use functions like EXTRACT but I do not find how to extract the whole date only.

I will very much appreciate your feedback.

Respectfully,
Jorge Maldonado

--

Scott Ford
Director of Development

Bullfrog Power Inc.
366 Adelaide Street West, Suite 701
Toronto, ON  M5V 1R9

t:  416.300.8443
f:  416.360.8385

w. bullfrogpower.com


    

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Extract date portion of a datetime field
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Extract date portion of a datetime field