select id,name,price,max(time) from table where time --填写指定时间的条件。 group by id,name,price
第2个回答 2013-03-19
select * from TABLE where time <= 指定时间 order by time desc limit 1追问
limit 1 语法错误。
追答
什么数据库?
第3个回答 推荐于2018-03-15
select * from tb a where time=
(select max(time) from tb where a.name=name and time<@time)本回答被提问者和网友采纳
第4个回答 2013-03-19
select a.* from table a where exists (select 1 from (select name,max(time) as time from table where time<指定time group by name) b where a.name=b.name and a.time=b.time)