Обсуждение: dates

Поиск
Список
Период
Сортировка

dates

От
mixo
Дата:
I have a table with column of time stamps of when a row entry was created.
How can I get the entries of a particular day (date) from these without
having to
resort to 'where creation_date like somedate' ?




Re: dates

От
Stephane Bortzmeyer
Дата:
On Fri, Apr 05, 2002 at 04:14:15PM +0200,
 mixo <mixo@beth.uniforum.org.za> wrote
 a message of 13 lines which said:

>
> I have a table with column of time stamps of when a row entry was created.
> How can I get the entries of a particular day (date) from these without
> having to
> resort to 'where creation_date like somedate' ?

select * from MYTABLE where extract (day from MYDATECOLUMN) = extract (day from timestamp '2001-03-08') ;

http://www.fr.postgresql.org/users-lounge/docs/7.2/postgres/functions-datetime.html#FUNCTIONS-DATETIME-DATEPART