Re: Wildcard in date field???

Поиск
Список
Период
Сортировка
От Ed Loehr
Тема Re: Wildcard in date field???
Дата
Msg-id 39527922.D0C8E9F2@austin.rr.com
обсуждение исходный текст
Ответ на Wildcard in date field???  (Web Manager <web@inter-resa.com>)
Список pgsql-sql
Web Manager wrote:
> 
> I need to make a query that will select items that have a date matching
> the current month for example.
> 
> For June this means that any day between 2000-06-01 and 2000-06-30 are
> ok. To do that I need a wildcard like "%" to replace the actual day in
> the date field.
> 
> Ex.:  select * from item where date = '2000-06-%%';

Multiple ways to do it, but here's one:
select * from item where date_part('month',mydate) = 6   and date_part('year',mydate) = 2000;

Regards,
Ed Loehr


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

Предыдущее
От: Dorin Grunberg
Дата:
Сообщение: Re: Wildcard in date field???
Следующее
От: Jesus Aneiros
Дата:
Сообщение: Re: eliminating duplicates in results..