select distinct id Price Date from table where date >=all( select max(date) from table)
select distinct id Price Date from table order by data desc//就是让你的结果按递减的顺序排列 ok,就会显示你上面的结果
没有想到更好的,这个给你: select a.* from store a, (select sid, max(scount) as scount from store group by sid) b where a.sid = b.sid and a.scount = b.scount order by a.sid
ID Date Table分别替换我语句中sid, scount, store就OK了
SELECT Table.id, Table.Price, Table.date FROM Table,(SELECT Table.id, Max(Table.date) AS MDate FROM Table GROUP BY Table.id) as b WHERE (((Table.date)=b.MDate));
from table
where date >=all(
select max(date)
from table)
from table order by data desc//就是让你的结果按递减的顺序排列
ok,就会显示你上面的结果
select a.* from store a,
(select sid, max(scount) as scount from store group by sid) b
where a.sid = b.sid and a.scount = b.scount order by a.sid
FROM Table,(SELECT Table.id, Max(Table.date) AS MDate
FROM Table GROUP BY Table.id) as b
WHERE (((Table.date)=b.MDate));