RE: newbie:how can i get day of week data type...

Поиск
Список
Период
Сортировка
От Tamsin
Тема RE: newbie:how can i get day of week data type...
Дата
Msg-id NEBBKHBOBMJCHDMGKCNJIEIACPAA.tg_mail@bryncadfan.co.uk
обсуждение исходный текст
Ответ на newbie:how can i get day of week data type...  ("Muhammad Rusydi" <rusydi@cbn.net.id>)
Список pgsql-general
use the date_part function:

test=# select date_part('dow',current_timestamp);
 date_part
-----------
         4
(1 row)

or:

select date_part('dow',day) from schedule;

where 'dow' is the day of week.

see the user docs for other date/time functions

hth
tamsin

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Muhammad Rusydi
> Sent: 14 June 2001 11:24
> To: postgres general
> Subject: [GENERAL] newbie:how can i get day of week data type...
>
>
> i've created this table:
> create table schedule (
> day date,
> tm timestamp,
> room char(4));
>
> insert into schedule values ('20/06/2001','08:00:00','A104');
>
> my problem is how to get day of week information from date or is there any
> way to do this?
> would you show me how to do it?
> thank's
> Didi
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl
>


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

Предыдущее
От: "Muhammad Rusydi"
Дата:
Сообщение: newbie:how can i get day of week data type...
Следующее
От: Einar Karttunen
Дата:
Сообщение: Re: OIDs overflow