MySQL part function uses

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.