直接这样难道不行:
select count(1) from 表 where field1='express'

解决方案 »

  1.   

    判断在表中是否存在 field1为 express的记录if exists(select * from table where field1='express')
        ............. --存在时的情况
    else 
        ................. --不存在时的情况
      

  2.   

    select 
       field1=case when field1='express' then ... else ... end,
       field2
    from
       表
      

  3.   

    case when 有两种用法:
    1.  case  when  (逻辑表达式) then (逻辑为真的结果) else (为假的结果) end
    2   case  表达式或字段名 when  值的情况 then 为前值时的结果 else ...   end
      

  4.   

    if exists(select * from tb where field1=(case when field1 ='express' then field1 Else '@@@@@@ddddd' End))
                  Print 'exists'
      

  5.   

    学习 SQL Server 啊 努力 奋斗-----------------------------------------------------