select * from t
where 列 like '%''%'
      and 列 not like '%''''%'

解决方案 »

  1.   

    select * from t
    where charindex('''',col)>0
     and charindex('''''',col)=0
      

  2.   

    create table #t1
    (g1 char(2),
        g2 varchar(10))insert into #t1
    select 'a','''adfasdf' 
    union all select 'b','b''c'
    union all select 'c','cd'''
    union all select 'd','a''''b'select *
    from #t1
    where g2='b''c'select * from #t1
    where g2 like '%''%'
          and g2 not like '%''''%'
    drop table #t1
    ============
    结果:(所影响的行数为 4 行)g1,g2
    b ,b'c(所影响的行数为 1 行)g1,g2
    a ,'adfasdf
    b ,b'c
    c ,cd'(所影响的行数为 3 行)