MONTH Function - SQL Server to MySQL Migration

In SQL Server and MySQL, the MONTH function extracts the month number from the datetime.

SQL Server:

  -- Get the month
  SELECT MONTH('2024-10-24');
  # 10

MySQL:

  -- Get the month
  SELECT MONTH('2024-10-24');
  # 10

For more information, see SQL Server to MySQL Migration.