Emi Lu написа:
Good morning,

Could someone tell me the command to get the weekly day name and day number please.


I am expecting something like:

sql> select data_part('day name', current_date);
sql> Monday

sql> select data_part('day number', current_date);
sql> 1

(Mon =1 ... Sun =7?)

You need "TO_CHAR" (http://www.postgresql.org/docs/current/static/functions-formatting.html) - "SELECT to_char(current_date, 'Dy')".


--
Milen A. Radev


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to