select id from ids where id = fatherid
在前面加上   not

解决方案 »

  1.   

    select id from ids where id not in (select fatherid from ids)
      

  2.   

    select id from ids where id not in (select fatherid from ids)
      

  3.   

    哈哈,晚了晚了,我和ivan的意见一样,我已经试过了,可以
      

  4.   

    被人抢先了,重复一次吧
    select id from ids where id not in (select fatherid from ids) 
      

  5.   

    用自关联是最好的,SELECT嵌套不好
      

  6.   

    lzy5042(老山)  songyangk(小草) 的方法不行吧,你们试过吗?BrentIvan(Ivan) 的可一试一试