Топ-100
 
CerebroSQL

YEARWEEK

Database: MySQL

68747470733a2f2f7374796c65732e7265646469746d656469612e636f6d2f74355f32716d366b2f7374796c65

Topic

Syntax:
YEARWEEK(date), YEARWEEK(date,mode)

Returns year and week for a date. The year in the result may be
different from the year in the date argument for the first and the last
week of the year.

The mode argument works exactly like the mode argument to WEEK(). For
the single-argument syntax, a mode value of 0 is used. Unlike WEEK(),
the value of default_week_format does not influence YEARWEEK().

URL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

Example

mysql> SELECT YEARWEEK('1987-01-01');
-> 198652