1, Date_add
Reference blog: MySQL Date time function Daquan
Example: Date_add (date,interval expr type)
2. Date to String Date_format
Reference Blog: The conversion between dates and strings in MySQL
Cases:
Mysql> Select Date_format (now (), '%y-%c-%d%h:%i:%s '); +----------------------------------------+| Date_format (now (), '%y-%c-%d%h:%i:%s ') |+----------------------------------------+| 2009-8-07 06:59:40 |+----------------------------------------+1 row in Set (0.00 sec)
3. Limit Paging
Reference blog: MySQL limit query optimization analysis
Cases:
SELECT * FROM table limit 10000,10
Run multiple times and keep time at around 0.0187
SELECT * FROM table Where vid >= (select vid from table Order by vid limit 10000,1) limit 10
Run several times, the time remains around 0.0061, only the former 1/3. You can expect the larger the offset, the better the latter.
MySQL part function uses