什么意思,是不是只有一个记录的type的记录?select * from tablename 
where type in (
  select type from tablename group by type having count(*)=1
  )

解决方案 »

  1.   

    我想他的要求特简单Select * From TableName 
    Where Type='特定type'
      

  2.   

    楼主的意思未表达清楚
     Yang_(扬帆破浪) 求出的是此表中Type只出现过一次的所有的记录,不知道是不是你想要的!
      

  3.   

    Select * From acct_item
    Where acct_item_type='月租费'
     and  billing_cycle_id=200206  
      

  4.   

    select * from acct_item
    where (acct_item_type='月租费') and billing_cycle_id not in
    (select billing_cycle_id from acct_item where
     acct_item_type in 
    (select acct_item_type from  acct_item where acct_item_type <>'月租费'))
      

  5.   

    select * from acct_item where acct_item_type = '月租费' and  acct_item_id Not in (Select distinct acct_item_id from acct_item where acct_item_type <> '月租费'))
      

  6.   

    select * from acct_item
    where (acct_item_type='月租费') and billing_cycle_id not in
    (select distinct acct_item_id from  acct_item where acct_item_type <>'月租费'))