Here is a sample:
--Top 2 for each state.
SELECT State,
Town,
Pop
FROM MyTable
WHERE Pop In
(SELECT Top 2 Pop
FROM MyTable As T2
WHERE T2.State = MyTable.State
ORDER BY Pop Desc
)
Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
http://mvp.microsoft.com/en-us/mvp/Bill%20Mosca-35852
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com
__._,_.___
Posted by: wrmosca@comcast.net
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (2) |
.
__,_._,___
Tidak ada komentar:
Posting Komentar