MYSQL uses Limit to Limit the number of updated rows

Source: Internet
Author: User

MYSQL uses Limit to Limit the number of updated rows to modify the config table. Change is_ OK of row 5607 to true. The following SQL statement is used to implement the SQL code UPDATE channel_config set is_adam_pub = 1 where channel_id in (select channel_id from channel_config limit 5607). It is found that Mysql does not support Limit clauses, the database reports This version of MySQL doesn't yet support 'limit & IN/ALL/ANY/SOME subquery, you can use the LimitSql code UPDATE channel_config set is_adam_pub = 1 where channel_id in (select t. channel_id from (select channel_id from channel_config limit 5607) as t); in this way, although the results can be achieved, the execution is very slow and it takes 15.815 ms to think about it, does update have limit usage? SQL code UPDATE channel_config set is_adam_pub = 1 LIMIT 5607; found that it was successful, and 0.102 ms -- end --

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.