update gsglsjdb.gs_jl_rgrd a
set (a.swdjzh,a.nsrmc)=(select b.swdjzh,b.nsrmc from djdb.dj_jl_jbsj b where a.jsjdm=b.jsjdm)
where exists (select * from djdb.dj_jl_jbsj where jsjdm=a.jsjdm);
此sql语句为:拿到jbsj表中的swdjzh和nsrmc,更新rgrd表中的swdjzh和nsrmc字段
select id,jsjdm,nsrmc,pcyy from gsglsjdb.pcmd2_bak order by jsjdm,cast(id AS int) desc;此sql语句为:把字符型的id字段当成int型字段排序
本文介绍了一种使用SQL更新指定表中特定字段的方法,并展示了如何通过将字符串类型的字段转换为整数类型来实现有效排序。
1万+

被折叠的 条评论
为什么被折叠?



