S
S
sswwssww2020-01-15 20:17:16
SQL
sswwssww, 2020-01-15 20:17:16

How to change values ​​only in those fields that are in another related table?

There are two tables related by key. You need to go through the first one and change the values ​​in those fields whose keys are selected in the second table according to some condition.
Example:
table 2: Next, I go over table 1 and change the fields for those rows that have an id field in the selection from table 2 above. Please tell me how this can be done?
select id, name from abc where name like '%van%'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman, 2020-01-15
@sswwssww

UPDATE ...
WHERE id IN (SELECT id ...)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question