0

In MySQL,

SELECT WEEK('2019-01-07')

is showing week number 1.

But if I see, 2019 starts from Tuesday and current week for that date is week number 2.

How can I get the current week according to the year in this way?

oniramarf
  • 843
  • 1
  • 11
  • 27
lil-wolf
  • 372
  • 2
  • 15

1 Answers1

2

Maybe you need WEEKOFYEAR function:

SELECT WEEKOFYEAR('2019-01-07'); # returns 2
oniramarf
  • 843
  • 1
  • 11
  • 27