Run multiple update / select from one query
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.
Subject
Views
Written By
Posted
Run multiple update / select from one query
3360
November 26, 2017 11:29PM
727
November 27, 2017 12:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.