sql里带有between and 这样的条件查询 怎么做SQL字符串拼接
发布网友
发布时间:2024-10-19 08:12
我来回答
共1个回答
热心网友
时间:2024-10-30 06:08
按正常的拼接方法来拼接就可以
如
declare @sql varchar(200),@c1 integer,@c2 integer
set @sql = 'select * from table1 where col1 between' + cast(@c1 as varchar(10)) + ' and ' + cast(@c2 as varchar(10))
热心网友
时间:2024-10-30 06:08
按正常的拼接方法来拼接就可以
如
declare @sql varchar(200),@c1 integer,@c2 integer
set @sql = 'select * from table1 where col1 between' + cast(@c1 as varchar(10)) + ' and ' + cast(@c2 as varchar(10))