在表中快速查出状态没有 Released 的记录。
例如 1100580 就是状态中没有 Released 的编号    状态
----------------
1100580 Planned
1100580 Reserved
1100580 Partially Delivered
1100580 Partially Delivered
1100580 Delivered
1100580 Delivered
1100580 Partially Delivered
1100580 Partially Delivered
1100581 Partially Delivered
1100581 Invoiced/Closed
1100581 Delivered
1100581 Invoiced/Closed
1100581 Picked
1100581 Reserved
1100581 Partially Delivered
1100581 Released

解决方案 »

  1.   


    select *
    from tb1
    where replace(状态,'Released','') = 状态
      

  2.   


    select *
    from tb1
    where 状态 not like '%Released%'
      

  3.   

    select * from tab_name 
    where 编号 not in
    (select 编号 from tab_name where 状态='Released');
      

  4.   

    select distinct 编号 from tab_name 
    where 编号 not in
    (select  编号 from tab_name where 状态='Released');
      

  5.   

    select * from  t t1 where not exists(select 1 from t t2 where t1.编号=t2.编号 and t2.状态='Released')