How to achieve creating a trigger that ONLY updates if exist but NEVER inserts in mysql.
Thanks in advance.
Edit: I had not known that using update statement just update if exist, and does not throw any error if not exist. Thanks to @juergend
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can specify when a trigger gets fired: after update for instance.
When it got fired then you can do whatever you want, for instance update an other table.
Generally it works like that:
MySQL keywords: