returning similar rows - simple probably!

  • Thread starter Thread starter Dave Mateer
  • Start date Start date
D

Dave Mateer

Hi

Code Area Postcode
X03Y Belmont 2234
X03W Belmont 6546
QC4Y Belmont 4153/54/55
T07X Strathdown 1123
B09G Ballach 7653

I have a table of around 2000 rows in MS Access 97. I want to make a
select statement to display rows only where there are multiple entries
for 1 area (eg I only want the query to return the first 3 entries
above).

Perhaps use the COUNT function: COUNT > 1?

Thanks in advance

Dave.
 
This gets you a list of duplicated areas.

select area from MyTable
group by area
having count(area) > 1

and this gets you the full details for each of them

select * from MyTable
where area in (
select area from MyTable
group by area
having count(area) > 1
)

Hope that works.
Jeremy Hughes
 
Back
Top