关于SQL求余的有关问题

关于SQL求余的问题在SQL中是否有求余函数,在有的博客中谈到用%来计算求余我所遇到的问题是:在SQL中写一条s

关于SQL求余的问题
在SQL中是否有求余函数,在有的博客中谈到用%来计算求余
我所遇到的问题是:
在SQL中写一条select语句,来求出一列值的余数(商值也行)。
望楼下粘出有效代码!
我所说的不是一个值,是一列
即:列名%3=X

[解决办法]
select 列名 % 3 as Col1 from A
[解决办法]

SQL code
declare @T table (col int)insert into @Tselect 13 union allselect 15 union allselect 17 union allselect 18 union allselect 19select *,col%3 as col的余数 from @T/*col         col的余数----------- -----------13          115          017          218          019          1*/
[解决办法]