SQL Function: MONTH()

Definition:

Return the month of provided date in number.


Command Syntax:

MONTH(date)

Command Example:

Table STUDENT
SID SNAME CLASS CNO DOB
010122 Chris Wong 1A 5 2011-02-01
010142 Nico Lin 1C 7 2011-08-21
010133 Amy Chan 2D 12 2010-03-06

Input:
SELECT MONTH(DOB) AS Result FROM STUDENT;

Output:
Result
2
8
3


‘Just a month’By secondary 6 student

Comments