selects on datetime

Поиск
Список
Период
Сортировка
От Scot Brady
Тема selects on datetime
Дата
Msg-id 81CA33A8DC6DD211AA0300A0C95D659F719C@ADMIN401
обсуждение исходный текст
Список pgsql-general

Hello all,

I have a table w/ a field of type datetime. I would like to do something like:
select count(jobs) for every day of a particular month and year.

my current select statement is:
Select count(job_id) from jobs where date_part('month',sub_dt)=2 and date_part('year',sub_dt)=1999 and date_
part('day',sub_dt)=?";

I then execute the statement filling the placeholder with days 1..31

There has to be a better way to do this since the select has to go through every row in the table. Any ideas?

thanks,
scot b.

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

Предыдущее
От: Paulo da Silva
Дата:
Сообщение: A security problem (newbie)
Следующее
От:
Дата:
Сообщение: Undeliverable Message