问题是这样的 我有个表table1 里面有个字段主键为ID ComIDList varchar(100) 有个表table2 主键为COMID int
现在ComID为'528,486,569,572'
select * from table2 where COMID in (select ComIDList from table1 where ID=12)
等同与
select * from table2 where COMID in ('528,486,569,572')但是这个是不对的 应该这样
select * from table2 where COMID in (528,486,569,572)但我不知道语句这么写 请教下 谢谢!~
现在ComID为'528,486,569,572'
select * from table2 where COMID in (select ComIDList from table1 where ID=12)
等同与
select * from table2 where COMID in ('528,486,569,572')但是这个是不对的 应该这样
select * from table2 where COMID in (528,486,569,572)但我不知道语句这么写 请教下 谢谢!~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货