Im trying to use IF query in update some entire row in my mysql table. As known IF query have 3 parameters. Part 1 of what you looking for, part 2 if its found / true and part 3 if its not found / false. I just want it to be update when its true and doing nothing if false. How to define 'dont do anything' so the false part wont be update into anything else? Sorry for my bad english. And thanks for your help.
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- sqlyog export query result as csv
You're confusing an update with a condition with a conditional update. For example the following is an update with a condition:
This is a conditional update:
The first version is applied to all rows, the second to all matching rows.
Use a
WHERE
clause to limit what rows yourUPDATE
is applied to.You can reassign the same value of column in FALSE part to do nothing.
Try this: