表A :   有一状态列 state  包含“开户”“注销”等等我如何写功能如select * from A where state = "开户" union all select * from A where state =  "注销"   的sql语句?state里的值太多 如果想上面这样写 太长了  求一同样功能sql注:如果用select * from A where state = "开户" or state = "注销" 的话  where 中有其他限制条件 就会使查询结果不对

解决方案 »

  1.   

    select * from A where (state = "开户" or state = "注销") and 其他限制条件
      

  2.   

    select * from A where (state = "开户" or state = "注销") and 其他限制条件在SQL 查询分析器里  报‘(’附近语法错误
      

  3.   

    select * from A where state in( "开户" , "注销", "停用")AND ……
      

  4.   

    select * from where (state = "开户" and xxx) or (state = xxx or xxx) and xxx
    这样行不行的?PS:偶是菜鸟,错了别骂偶...
      

  5.   

    在SQL 查询分析器里  报‘(’附近语法错误
    是因为括号是中文的
      

  6.   

    select * from A where state IN("开户","注销") 应该也可以