What should I do if the condition for php to operate MYSQL is more, better or less?

Source: Internet
Author: User
If you want to update sql1 & quot; updatetablesetaaaawhereid1 & quot; sql2 & quot; updatetablesetaaaawhereid1andclassid12andinfoid1 & quot ;; if delet php is used to operate MYSQL statements, the more the statements, the better, the less the statements, the better.
Ask
If you want to update
Sql1 = "update table set aa = aa where id = 1 ";
Sql2 = "update table set aa = aa where id = 1 and classid = 12 and infoid = 1 ";

Delete:
Sql1 = "delete from table where id = 1 ";
Sql2 = "delete from table where id = 1 and classid = 12 and infoid = 1 ";


Which of the following is better for SQL 1 and SQL 2 during update?
Which of the following is better for sql1 and sql2 during delete?

Please explain the reason. thank you.

------ Solution --------------------
So you don't need to ask this question... it's obvious that the old man (Mysql) can filter it out for you. Otherwise, I would like to explain how to use the judgment conditions... the more accurate the conditions, the higher the execution efficiency, the more accurate the results. of course, the premise is that your indexes and SQL statements should be correctly written. In many cases, failing to write the conditions is counterproductive.

2. let me talk to the old man, who is 170 tall and 80 in the upper circle. call the lady who meets these conditions, and then find a lady who meets these conditions.

At this time, the old lady decided to find you a flower. after some XXOO, you found that his grandmother was a gender! Therefore, you must correct the conditions. Hahaha


Discussion

Reference:
The more conditions the database requires more work, just as the more moves you need, the more services the lady needs. So if you just need a climax, you may just have it after a crash. What kinds of poisonous dragons, ice and fire can be saved for two days... obviously, right. the premise is what services you actually need.


My idea is as follows:
If you are interested in Miss, let's talk about it:
If I look for a lady now, there are now 1000 for me to choose (so nice). If I want to find one ......

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.