mikedhart
mikedhart

Reputation: 423

Updating a table column based on another tables results using mysql only

I have a set of results - SELECT id FROM recruit_index WHERE YEAR NOT LIKE '2011'

I need to update another table column based on each of the above ids using mysql only.

Could anyone point me in the right direction?

Thanks in advance

Mike

Upvotes: 1

Views: 513

Answers (1)

Dan
Dan

Reputation: 548

Use:

UPDATE recruit_index, other_table set other_table.column={new value here}
WHERE recruit_index.id = other_table.id and recruit_index.year not like '2011';

Upvotes: 1

Related Questions