May 2005
Intermediate to advanced
352 pages
14h 39m
English
MONTH( )
MONTH(date)This function returns the numeric value of the month (1-12) for the date provided.
SELECT MONTH(appointment)
AS Appointment
FROM appointments
WHERE client_id = '8302'
AND appointment > CURRDATE( );
+-------------+
| Appointment |
+-------------+
| 6 |
+-------------+This SQL statement is retrieving the month of any appointments after the current date for a particular client. There's only one appointment, and it's in June.
Read now
Unlock full access