SQL取整数的问题,在线等.谢谢!!!
要求:
IF x=2053
x=2050
IF x=2507
x=2500
IF x=3557
x=3550
IF x=4277
x=4250
谢谢谢谢!!!
------解决方案--------------------declare @x1 int,@x2 int,@x3 int,@x4 int
select @x1=2053,@x2=2507,@x3=3557,@x4=4277
select (@x1/50)*50,(@x2/50)*50,(@x3/50)*50,(@x4/50)*50
/*
----------- ----------- ----------- -----------
2050 2500 3550 4250
*/