I want to retrieve day of the week from the given date.
For example the date is: 2015-01-28
then it has to return Wednesday
select date_part('week',now()) as weekday;
The above script gives me only number of week but not the day of the week.
Try to_char()
:
select to_char(now(), 'Day')