Mondeo Posted December 9, 2006 Posted December 9, 2006 I have this table Postcode Town County BB9 4TL Burnley Lancashire BB9 4TP Burnley Lancashire BB8 4TJ Burnley Lancashire PR8 4YU Preston Lancashire PR4 3TY Preston Lancashire FY4 4TY Blackpool Lancashire FY7 9TY Blackpool Lancashire Theres a lot more, its over a million rows but what I want to end up with is unique town/county pairs with either the first postcode, or any postcode relating to that pair. So my results should look like: Postcode Town County BB9 3TL Burnley Lancashire PR8 4YU Preston Lancashire FY4 4TY Blackpool Lancashire Thanks Quote
MrPaul Posted December 9, 2006 Posted December 9, 2006 GROUP BY clause Something like this should work: SELECT ... FROM ... GROUP BY Town In my experience this would return one record per Town (usually the first). Good luck :) Quote Never trouble another for what you can do for yourself.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.