week
BigQuery
Db2 (LUW)
MariaDB
MySQL
Oracle DB
PostgreSQL
SQL Server
SQLite
2005
2007
2009
2011
2013
2015
2017
2019
2021
2023
8.3 - 18
b
c
5.0 - 9.5.0
a
5.1 - 12.0.2
a
11.5.7 - 12.1.2
b
e
⚡ 11.5.6
d
e
11.1 - 11.5.5
d
2.0
c
2.0
a
Sunday-based weeks with first Sunday in year
ISO 8601 week date (year’s first Thursday)
Use
extract(isoyear)
for the corresponding year
Buggy? Jan 1 seems to be always week 1
Buggy! E.g. 2005-01-01 till 2005-01-08 all belong to week 1 (Eight days a week)