select * from (SELECT '123' dimFilterIds UNION ALL SELECT '1456' dimFilterIds UNION ALL SELECT '2123' dimFilterIds )budg_template_dims where CHARINDEX(','+ '123' +',' , ','+ dimFilterIds +',') > 0 select * from (SELECT '123' dimFilterIds UNION ALL SELECT '1456' dimFilterIds UNION ALL SELECT '2123' dimFilterIds )budg_template_dims WHERE ','+dimFilterIds+',' like '%,123,%'
原文
https://www.cnblogs.com/goody9807/archive/2011/07/27/2118107.html
https://blog.csdn.net/lihaiyong92/article/details/104369577