Simple trigger consult, after up to judge the value, and then modify a value

Source: Internet
Author: User
Everyone is very good, recently just contacted PHP and MySQL know that MySQL has a trigger, there is a small program need to automatically determine the value to modify another field value, to be implemented by a trigger, or by the way to learn the trigger. So come to ask you a big,
So, the user table has 2 fields, one is Jifen, the other is Dengji,
The trigger needs to be judged when the Jifen changes:
If Jifen is greater than or equal to 5000 Dengji is 2,
If Jifen is greater than or equal to 10000 Dengji is 3,

is in a table, do not know the trigger can be implemented? How does a trigger write?


Reply to discussion (solution)

Landlord this situation does not need to use the trigger Ah, you are not just want to test, it is recommended to learn the basics of flip-flop is good.

  • 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.