select phone from tablename where phonedate='2005-8-24' group by phone

解决方案 »

  1.   

    只是当日不重复,不是历史不重复????
    什么意思?
    既然有phonedate='2005-8-24',已经限制是这一天了
      

  2.   

    就是因为select distinct(phone) from tablename where phonedate='2005-8-24'
    这句不对,达不到,和历史对比的效果,才来问的啊
      

  3.   

    其实我的目的是想达到。每天从数据库中提取出与以往历史不同的号码。我晕啊,我发现distinct(phone)过滤的号码是随机的。有可能把历史和今天重复的号码
    虽然只显示一条,但有可能就显示在今天的查询中,这样就达不到结果了。各位有什么好办法啊?
      

  4.   

    select * from  tablename  where phone not in (select  distinct(phone) tablename where phonedate<>'2005-8-24')
    看看能不能达到你的要求!