更新table_1设置tik = 1,其中权重350,375左右b 请帮助Sir while using sqlserver, I have this dataI want to update TIK column as like thisFormula:If found tik=1 then it pick up weight that is 375Now 375-25=350Update table_1 set tik= 1 where weight between 350,375Please help tqmd 表格必须只根据First TIK + ID更新一次Table must be updated only once based on First TIK+ID第一个TIK的ID是6 The ID of first TIK is 6推荐答案 抱歉无法立即测试声明@ w int =(从tbl中选择前1个权重,其中tik = 1个顺序按重量 desc)declare @w int =(select top 1 weight from tbl where tik=1 order by weight desc) 更新table_1设置tik = 1,其中权重> = @ w-25和 重量< @w Update table_1 set tik= 1 where weight >=@w-25 and weight <@w 这篇关于表更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 10-28 02:22