Format date as day of week

前端 未结 3 1780
滥情空心
滥情空心 2020-12-05 11:55

I have a table which has amongst others a date column servdate.

I use the following query to get me all jobs from within the past week ( a week starts f

3条回答
  •  渐次进展
    2020-12-05 12:20

    Here a suggestion involving less typing than the CASE ... WHEN block. Here, the same is done by substring extraction:

    select substr('SunMonTueWedThuFriSat', 1 + 3*strftime('%w', timestr), 3) as dow
    from ...
    

    It produces only fixed length abbreviations instead of full weekday names, though. (But sometimes that's enough.)

提交回复
热议问题