MySQL -zelfstudie

MySQL HOME MySQL-intro MySQL RDBMS

MySQL SQL

MySQL SQL MySQL SELECT MySQL WAAR? MySQL EN, OF, NIET MySQL BESTELLEN DOOR MySQL INVOEGEN IN MySQL NULL-waarden MySQL-UPDATE MySQL VERWIJDEREN MySQL-LIMIET MySQL MIN en MAX MySQL-COUNT, AVG, SUM MySQL LIKE MySQL-jokertekens MySQL IN MySQL TUSSEN MySQL-aliassen MySQL wordt lid MySQL INNER JOIN MySQL LEFT JOIN MySQL RECHTS AANMELDEN MySQL CROSS JOIN Zelf lid worden van MySQL MySQL UNION MySQL GROEP DOOR MySQL HEBBEN MySQL BESTAAT MySQL ELK, ALLES MySQL INSERT SELECT MySQL-CASE MySQL Null-functies MySQL-opmerkingen MySQL-operators

MySQL- database

MySQL DB maken MySQL Drop DB MySQL-tabel maken MySQL-droptabel MySQL Wijzig Tabel MySQL-beperkingen MySQL Niet Null MySQL Uniek MySQL primaire sleutel MySQL-buitenlandse sleutel MySQL-controle MySQL-standaard MySQL-index maken MySQL automatisch verhogen MySQL-datums MySQL-weergaven

MySQL- referenties

MySQL-gegevenstypen MySQL-functies

MySQL- voorbeelden

MySQL-voorbeelden MySQL-quiz MySQL-oefeningen

MySQL WEEK() Functie

❮MySQL-functies

Voorbeeld

Retourneer het weeknummer voor een datum:

SELECT WEEK("2017-06-15");

Definitie en gebruik

De functie WEEK() retourneert het weeknummer voor een bepaalde datum (een getal van 0 tot 53).

Syntaxis

WEEK(date, firstdayofweek)

Parameterwaarden

Parameter Description
date Required.  The date or datetime to extract the week number form
firstdayofweek

Optional. Specifies what day the week starts on. Can be one of the following:

  • 0 - First day of week is Sunday
  • 1 - First day of week is Monday and the first week of the year has more than 3 days
  • 2 - First day of week is Sunday
  • 3 - First day of week is Monday and the first week of the year has more than 3 days
  • 4 - First day of week is Sunday and the first week of the year has more than 3 days
  • 5 - First day of week is Monday
  • 6 - First day of week is Sunday and the first week of the year has more than 3 days
  • 7 - First day of week is Monday

Technische details

Werkt in: Van MySQL 4.0

Meer voorbeelden

Voorbeeld

Retourneer het weeknummer voor een datum:

SELECT WEEK("2017-10-25");

Voorbeeld

Retourneer het weeknummer voor de huidige systeemdatum:

SELECT WEEK(CURDATE());

❮MySQL-functies