Êý¾Ý¿âÀïÈýÌõ¼Ç¼¼Ç¼£º
1,101,343,332,34
11,22,33,44,55
33,342,432,12,1
ÆäÖÐÒ»ÐÐΪһÌõ¼Ç¼
Ôõô¶ÁÄÚÈÝÖаüº¬1µÄÖµ£¬µ±È»11Êǿ϶¨ÊDz»ÓöÁ³öÀ´µÄ
ÎÒÓà ×Ö¶Î like '%1%'µÄʱºò µÚ¶þÌõ¼Ç¼Ҳ»á¶Á³öÀ´
Óà ×Ö¶Î like '%1,%'µÄʱºò µÚÈýÌõ¼Ç¼¾Í¶Á²»³öÀ´ÁË
Çë½ÌÓÐûÓнâ¾ö°ì·¨
SQL code:
select * from tb where charindex('1',col)>0
SQL code:
CHARINDEX(',1,',',1,101,343,332,34 ,')>0
SQL code:
where ','+×Ö¶Î+',' like ',1,'
SQL code:
where charindex(',',1,',',col)>0
SQL code:
select * from TableName where charindex(',1,',','+[×Ö¶Î]+',')>0
ºÇºÇ£¬Ã»¿ãñÃÁË
SQL code
Code highlighting prod