select top 3 EmploeeFile group by depart order by salary
to 夏天: select top 3 EmploeeFile group by depart order by salary如是这样早就解决了,没有这么简单吧。
为什么没这么简单? select top 3 * from EmploeeFile group by depart order by salary
改一下 select top 3 * from EmploeeFile order by depart,salary desc
我解决了:SELECT * FROM z_class AS a WHERE a.autoid in (select top 1 ff.autoid from z_class ff where ff.class_id=a.class_id order by ff.sect_id desc) ORDER BY a.class_id, a.sect_id DESC;增加一个 autoid字段。(此语句在access-xp下测试通过)非常感谢大家的讨论,如有效率更高的语句欢迎贴出来。
select top 3 EmploeeFile group by depart order by salary如是这样早就解决了,没有这么简单吧。
select top 3 * from EmploeeFile group by depart order by salary
select top 3 * from EmploeeFile order by depart,salary desc
FROM z_class AS a
WHERE a.autoid in (select top 1 ff.autoid from z_class ff where ff.class_id=a.class_id order by ff.sect_id desc)
ORDER BY a.class_id, a.sect_id DESC;增加一个 autoid字段。(此语句在access-xp下测试通过)非常感谢大家的讨论,如有效率更高的语句欢迎贴出来。