select count(*) from T1 where sort1 = 'iso9000' or sort2 = 'iso9000'select count(*) from T1 where sort1 = 'iso14000' or sort2 = 'iso14000'

解决方案 »

  1.   

    select count(*) from table 
    where rtrim(sort1) + rtrim(sort2) ='iso9000iso14000' or  rtrim(sort2) +rtrim(sort1) ='iso9000iso14000' 
      

  2.   

    select count(*) as 通过9000的数目 from T1 where sort1 = 'iso9000' or sort2 = 'iso9000'select count(*) as 通过14000的数目 from T1 where sort1 = 'iso14000' or sort2 = 'iso14000'
      

  3.   

    select sum(case when sort1='iso9000' or sort2='iso9000' then 1 end) iso9000数量,sum(case when sort1='iso14000' or sort2='iso14000' then 1 end) iso14000数量  from 表
      

  4.   

    iso9000 是代表 iso9000系列
    iso14000 是代表 iso14000系列
    而不仅仅是iso9000 和iso14000 !!!help !!!
      

  5.   

    iso9000系列包括  iso9001 iso9002 ......
      

  6.   

    select count(*) from T1 where sort1 like 'iso900%' or sort2 like 'iso900%'select count(*) from T1 where sort1 = 'iso14000' or sort2 = 'iso14000'
      

  7.   

    select count(*) from T1 where sort1+sort2 like '%iso9000%'
    select count(*) from T1 where sort1+sort2 like '%iso4000%'