Query - seperating items in a large database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database with a lot of telephone services, we have purpose codes for
the different type of services

for example
MBL - is for normal mobile phones
WDCD - is for Wireless Data Connectivity Device ( EVDO cards in a laptop)
BBWD - Blackberry devices

what I want to do is run a query that strips out anybody who has just one of
the above which will leave everybody which has more than one mobile,
Blackberry or a WDCD device so I can then chase up as they should not have
more than one of each device.

I would appreciate any assistance
fraustrated Tommo
 
Tommo,

If I understand you correctly, something like this...

SELECT Person, DeviceType
FROM YourTable
GROUP BY Person, DeviceType
HAVING Count(ID)>1
 
My understanding differs from Steve's. I thought you wanted persons that
had more than one of the combination of the devices. - That is one MBL and
one WDCD or even 2 MBL. So here is my take on Steve's example.

SELECT Person
FROM YourTable
WHERE DeviceType In ("MBL","WDCD","BBWD")
GROUP BY Person
HAVING Count(Person)>1
 
Back
Top