嗯~``应该是正确的吧~假如你的tid是int型的话~
delete  from  cdb_threads  where  tid  not  in  (select tid  from  cdb_posts)

解决方案 »

  1.   

    delete  from  cdb_threads as a 
    where not  exists(select *  from  cdb_posts as b where a.tid=b.tid)  
    看看这个可行? 
      

  2.   

    有可能cdb_post表中的数据scdb_threads表中都有,不符合where 子句的条件,所以就不对那一行进行操作(删除)喽!
      

  3.   

    表cdb_posts中不存在一条记录对应cdb_threads表ATID字段的数据
    就应该把cdb_threads表ATID字段对应表cdb_posts的数据全删除应该是in而不是not in吧
    delete  from  cdb_threads  where  cdb_threads.atid  in  (select  cdb_posts.atid  from  cdb_posts) 
    感觉题目好模糊呀..