In mysql it is possible to make a fork in the command “SET”?
Like this:
UPDATE `table`.`data` SET `hits` = (`hits`-1<0 ? 0:`hits`-1) WHERE `data`.`id`='15';
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.
Use the
IFfunction:In this specific case you could also use
LEAST.Your code seems wrong though. I’m almost certain that you meant to write this: