id   name   xtdate      number  type
1    冰箱  2007-02-05    2       销售
2    电视  2007-02-05    2       销售
3    冰箱  2007-02-10    3       销售查询2007-02-06 日以后就没有销售记录的信息:
结果:
2    电视  2007-02-10    2       销售

解决方案 »

  1.   

    不知道你要取出几条数据,如果是一条按照下面的试下:
    应该可以
    Select A.* from table1 A
    where A.id=(select count(*) from table1 where xtdate > 2007-02-06)-1)
      

  2.   

    select * from table_name 
    where type = '销售'
    and xtdate <= '2007-02-06'
    and name not in (
    select name from table_name where xtdate > '2007-02-06' and type = '销售' 
    )