欢迎投稿

今日深度:

数据库 批量查询结果作为更新的值,批量查询结

数据库 批量查询结果作为更新的值,批量查询结果


数据库批量更新。

业务需求:

需要将a表中 type为1 的数据的source_id更新为新的id。

因为之前的id是存储在p_server中,现在更新到了server_info表中

update a set source_id = s.server_id  from 
(select p_server.p_id,p_server.index_code,server_info.server_id 
from p_server join server_info 
on p_server.index_code = server_info.index_code) s where 
a.source_id = s.p_id
and type = 1;


www.htsjk.Com true http://www.htsjk.com/shujukunews/5286.html NewsArticle 数据库 批量查询结果作为更新的值,批量查询结果 数据库批量更新。 业务需求: 需要将a表中 type为1 的数据的source_id更新为新的id。 因为之前的id是存储在p_server中,现在更新到了se...
评论暂时关闭