Hi,
I need a query command to update multiple rows to set the alertState (char(1) to true if any tables match following conditions:
- the last contact time < now - timeout
- the the alertState = false
I tried following command, but it got syntax problems:
update Device set alertState = 1 where (select alertState, lastContact from Device where lastContact < 1511751383) and alertState = 0;
ERROR 1241 (21000): Operand should contain 1 column(s)
Also, is it possible to update multiple rows in one query?
Thank you.
I need a query command to update multiple rows to set the alertState (char(1) to true if any tables match following conditions:
- the last contact time < now - timeout
- the the alertState = false
I tried following command, but it got syntax problems:
update Device set alertState = 1 where (select alertState, lastContact from Device where lastContact < 1511751383) and alertState = 0;
ERROR 1241 (21000): Operand should contain 1 column(s)
Also, is it possible to update multiple rows in one query?
Thank you.