选择两列并对它们运行更新查询,并在单个查询中执行此操作

时间:2016-11-01 11:37:01

标签: mysql

我想从数据库ID和密码中选择两列 并希望在更新查询中使用这两列数据 示例

 select id , pass from table 
second update query
update table set password2=password_get_from select_query where id=id_get_from_select_query

1 个答案:

答案 0 :(得分:0)

尝试类似的东西。

update table_one as A
inner join table_two AS B on (A.id = B.id)
set A.some_column = B.some_column, 
A.another_column = B.another_column
where blah