开发者

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

开发者 https://www.devze.com 2023-01-22 19:28 出处:网络
I have a set of results - SELECT id FR开发者_运维知识库OM recruit_index WHERE YEAR NOT LIKE \'2011\'

I have a set of results - SELECT id FR开发者_运维知识库OM 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


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';
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号