Getting week number of date in SQL

前端 未结 6 1385
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-23 08:26

Is there a way to get the week number of a date with SQL that is database independent?

For example to get the month of a date I use:

SELECT EXTRACT(MONTH         


        
6条回答
  •  执念已碎
    2021-01-23 09:10

    There doesn't appear to be a single standard SQL function to extract the week number from a date - see here for a comparison of how different SQL dialects can extract different dateparts from date fields.

提交回复
热议问题