Thank you: http://www.111cn.net/database/110/d45124323da8d2d87b80f78319987eda.htm
View another blog on the same topic: http://blog.csdn.net/cleanfield/article/details/41447585
------------------------------------------------------------------------------
The first day of the quarter, and then you can convert the string back to a date. There are many methods, including aliases (synonyms) for the same function. such as Curdate (), Current_date (), current_date, now and so on can return to the same day
MySQL Tutorial > select Curdate (), ELT (QUARTER (Curdate ()),
Year (Curdate ()) *1000+0101,
Year (Curdate ()) *1000+0401,
Year (Curdate ()) *1000+0701,
-year (Curdate ()) *1000+1001) as FIRSTDAYOFQ;
+------------+-------------+
| Curdate () | FIRSTDAYOFQ |
+------------+-------------+
| 2009-05-19 | 2009401 |
+------------+-------------+
1 row in Set (0.00 sec)
Mysql>
Get the first day of the quarter with a MySQL statement
On the first day of this month,
Date
Concat (Year (Curdate ()), '-', Month (Curdate ()), '-', ' 1 '))
The first day of the week
Curdate ()-
WEEKDAY (Curdate ())
Get the first day of the quarter with a MySQL statement
Date
Concat (Year (Curdate ()), '-',
if (Quarter (Curdate ()) =1,1,if (Quarter (Curdate ()) =2,4,if (Quarter (Curdate ()) =3,7,10))
Get the first day of the quarter with a MySQL statement:
Optimization:
Date
Concat (Year (Curdate ()), '-', ELT (quarter (Curdate ()), 1,4,7,10), '-', 1))
The first day of the week
Date_add (Date (' 2009-5-29 '), Interval-weekday (' 2009-5-29 ') day)
MySQL Gets the same day published file content SQL statement
SELECT * from ' p8_memberdata ' where regdate between (Unix_timestamp (now ()) -86440) and now ()
SELECT * from ' p8_memberdata ' WHERE date_format (From_unixtime (regdate), '%y-%m-%d ') = Date_format (now (), '%y-%m-%d ') ORDER BY uid DESC
MySQL gets the first day of the month of the day of the quarter, the first day of the week SQL statement (RPM)