update bhk set 零售价=round(进价/0.7,1) where CAST(编号 AS BIGINT) BETWEEN 644181103 AND 644181118
不转换直接比较应该也行SELECT * FROM (SELECT '644181103' AS 'COL1' UNION ALL SELECT '644181104' UNION ALL SELECT '644181105' UNION ALL SELECT '644181118' UNION ALL SELECT '644181119' ) T where COL1 BETWEEN '644181103' AND '644181118'
update bhk set 零售价=round(进价/0.7,1) where rtrim(编号) BETWEEN '644181103' AND '644181118'
update bhk set 零售价=round(进价/0.7,1) where 编号 BETWEEN '644181103' AND '644181118'
如果编号为数值型,直接: update bhk set 零售价=round(进价/0.7,1) where 编号 between 644181103 and 644181118如果为字符型,建议把编号转为数值型再比较: update bhk set 零售价=round(进价/0.7,1) where cast(编号 as int) between 644181103 and 644181118
update bhk set 零售价=round(进价/0.7,1) where rtrim(编号) BETWEEN '644181103' AND '644181118' 更新在在'644181103' 和'644181118'范围内的数据
update bhk set 零售价=cast(进价/0.7 as decimal(14,2) where 编号>='644181103' AND 编号<='644181118' 更新在在'644181103' 和'644181118'范围内的数据
update bhk set 零售价=round(进价/0.7,1) where 编号 between 644181103 and 644181118
(SELECT '644181103' AS 'COL1'
UNION ALL SELECT '644181104'
UNION ALL SELECT '644181105'
UNION ALL SELECT '644181118'
UNION ALL SELECT '644181119'
) T
where COL1 BETWEEN '644181103' AND '644181118'
set 零售价=round(进价/0.7,1)
where rtrim(编号) BETWEEN '644181103' AND '644181118'
update bhk set 零售价=round(进价/0.7,1) where 编号 between 644181103 and 644181118如果为字符型,建议把编号转为数值型再比较:
update bhk set 零售价=round(进价/0.7,1) where cast(编号 as int) between 644181103 and 644181118
set 零售价=round(进价/0.7,1)
where rtrim(编号) BETWEEN '644181103' AND '644181118'
更新在在'644181103' 和'644181118'范围内的数据
set 零售价=cast(进价/0.7 as decimal(14,2)
where 编号>='644181103' AND 编号<='644181118'
更新在在'644181103' 和'644181118'范围内的数据
update bhk set 零售价=round(进价/0.7,1) where 编号 between 644181103 and 644181118