日期:2014-05-17  浏览次数:20736 次

简单问题:搜索表中某天以后没有记录的信息。
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               销售


------解决方案--------------------
不知道你要取出几条数据,如果是一条按照下面的试下:
应该可以
Select A.* from table1 A
where A.id=(select count(*) from table1 where xtdate > 2007-02-06)-1)
------解决方案--------------------
没看懂什么意思!