PostgreSQL:Get the Day Name of Week with One SQL

first show the sql,

dow means The day of week as Sunday (0) to Saturday (6),

so you just need now the number of day of week, then you can easily convert it to the name as you wish.

the PostgreSQL array simplifies the job, otherwise we need case when or store the day name of week in another table, then inner join it.

reference,

PostgreSQL 获得星期的名字

 

Leave a Reply