Re: Week number

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Week number
Дата
Msg-id GNELIHDDFBOCMGBFGEFOAEJJCAAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: Week number  (Markus Bertheau <twanger@bluetwanger.de>)
Список pgsql-hackers
> Then pgsql-novice is the correct list to ask this kind of question.
> > I want to obtain current week number.
> > Under PHP I try:
> >
> > $query = "SELECT EXTRACT(WEEK FROM NOW)";
> > $result= pg_exec($dbconn,$query);
>
> select date_part('week', CURRENT_TIMESTAMP);

I'll just point out that using date_part isn't ANSI SQL, you should use the
EXTRACT function, and the CURRENT_DATE, CURRENT_TIME and CURRENT_TIMESTAMP
variables.

Chris



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

Предыдущее
От: "Jim Buttafuoco"
Дата:
Сообщение: Re: 7.2beta3 on Digital Alpha
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Week number