SQL Function: DAY()

Definition:

Return the day of provided date in number.


Command Syntax:

DAY(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 DAY(DOB) AS Result FROM STUDENT;

Output:
Result
1
21
6


‘Just a day’By secondary 6 student

Comments