读书人

update更新用select语句得来的结果集

发布时间: 2012-04-07 17:31:51 作者: rapoo

update更新用select语句得来的结果集,要如何写语句?急
比如 select a.one,b.one where a.id=b.id

现在我要更新用上述语句得到的结果?

如何写update语句?

[解决办法]

探讨
SQL code
update t set one=b.one from a t where t.id=b.id

[解决办法]
SQL code
update t set t.one=b.one from a t,b where t.id=b.id
[解决办法]
探讨
比如 select a.one,b.one where a.id=b.id

现在我要更新用上述语句得到的结果?

如何写update语句?

[解决办法]
探讨
出:
SELECT bms_jobs
FROM boms LEFT OUTER JOIN part ON boms.bms_pno = part.part_no where bms_bomsno in (1272,1273,1311,1312,1314,1315,1317,1318,1320,1321,1323,1324,1326,1327,1329,1330,2922,2923,2925……

把查出的的bms_jobs清空

读书人网 >SQL Server

热点推荐