create table mytab(id int identity , name varchar(50))
这个表,第一个是自动编号的,
我现在有这样一个字符串
"1,2,3,6,9,4,5"
怎么可以查询出包含这些数字的记录来?
select * from mytable id in '1,2,3,6,9,4,5'
这样写不对呀,怎么搞?
高手帮助
这个表,第一个是自动编号的,
我现在有这样一个字符串
"1,2,3,6,9,4,5"
怎么可以查询出包含这些数字的记录来?
select * from mytable id in '1,2,3,6,9,4,5'
这样写不对呀,怎么搞?
高手帮助
我问的是sqlserver的东西
set @ids = '1,2,3,6,9,4,5'
exec ('select * from mytable where id in ('+@ids+')')