Back to Starrocks

weekofyear

docs/en/sql-reference/sql-functions/date-time-functions/weekofyear.md

4.1.0484 B
Original Source

weekofyear

Returns the week number for a given date within a year.

The date parameter must be of the DATE or DATETIME type.

Syntax

Haskell
INT WEEKOFYEAR(DATETIME date)

Examples

Plain
MySQL > select weekofyear('2008-02-20 00:00:00');
+-----------------------------------+
| weekofyear('2008-02-20 00:00:00') |
+-----------------------------------+
|                                 8 |
+-----------------------------------+

keyword

WEEKOFYEAR