1.

How does DAYOFMONTH (), DAYOFWEEK() and DAYOFYEAR( ) work?

Answer»

DAYOFMONTH( ) returns the day of the month for a given date in the range 1 to 3).

DAYOFWEEK ( ) returns the week day number (1 for Sunday, 2 for Monday .....).

DAYOFYEAR ( ) returns a number stating the no. of days passed so far.

(eg)

1.  SELECT DAYOFMONTH ('2016-05-31',) 31

2.  SELECT DAYOFWEEK ('2016-05-31') 3

3.  SELECT DAYOFYEAR ('2016-05-31') 152.  (31 + 29 + 31 + 30 + 31)



Discussion

No Comment Found

Related InterviewSolutions