1樓:匿名使用者
select top 1 * from tblname
where addtime between '2012-07-05' and '2012-09-30'
and state=1 order by addtime desc;
2樓:匿名使用者
select name,max(a.addtime),max(b.addtime) from table a left join
(select name,max(addtime) as addtime from table group by name)b
on a.name=b.name
where a.addtime<>b.addtimegroup by a.name
3樓:蟻年
select * from tablename where name='000003' addtime>'2012-07-05' and addtime<'2012-09-20' limit 1 ;
你自己修改下表名tablename就可以用了
4樓:去吧死去
select top 1 * from table where min(time)