Get System Current DateTime: Sysdate () Gets the system current date: Curdate () Gets the system current time: Curtime () Gets the year of the given date: yearly (date) Gets the month of the given date: month (date) A function that adds a time interval for the specified date: date_add (date,interval expr Unit) (1) query author's year of birth = year of birth = current year-author Age = Years (Curdate ())-Ages
Note: Current date curdate (), when the year before (Curdate ()) (2) query displays author information for the latest published date in the first half of the month select * from authors where Year (ISBN) =year (curdate ()) And Month (ISBN) >7; this year, the year is the current year: Years (ISBN) =year (curdate ()) in the first half, the month is less than 7:month (ISBN) <7
Note: Flexible use years () month ()
MySQL Date function current date curdate (), when year before last (Curdate ()), takes the date of years (date), takes the month of date (date)