I have a table where I want to update all rows with an identifier that exists as a result of the selection.
My pseudo code:
UPDATE mytable as t SET t.status = 'PM' WHERE t.ID EXISTS IN (select ID from ...)
I managed to make a select statement, now I want to use the result of the select statement to update the table.
If you delete the existing one, you have a valid request from what I can say.
UPDATE mytable SET status = 'PM' WHERE id IN (select ID from ...)
Works for me in MySql 5.5, I donβt know which database you are using.
You cannot use substitution in an UPDATE statement. The original query should be good if you do not consider the part βlike tβ and both βt.β.
Source: https://habr.com/ru/post/893839/More articles:JPA object database schema drawing in IntelliJ - javagcc for init-on-first-use functions - cIs there an analogue of the stringsearch package for Data.Text instead of ByteString? - haskellCakePHP: getting a specific table field in a controller - cakephpHow to drag and drop many files without using system resources? - c ++python regex to split into specific patterns with missing patterns - pythonRemove default JFrame icon - javaEncryption (MD5) several times can improve security? - encryptionGetting "Failed to authenticate using OAuth." from Twitter while trying to post - twitter-oauthIs it possible to send AJAX after closing the browser window? - javascriptAll Articles