How to find out common records with Where clause

From: Sanjeev <>
Date: Fri, 9 Jan 2009 04:08:03 -0800 (PST)
Message-ID: <>

Dear Gurus,

I have "VISITOR" table as follows.

VisitNo EmpName Address

1           Sanjeev       Mumbai
2           Rajeev         New-Mumbai
3           Shailesh      Mumbai
4           Ramesh      New-Mumbai

5           Sanjeev       Pune-1
6           Rajeev         Pune-2
7           Shailesh      Pune-3
8           Shreyas      Pune-4

9           Sanjeev       Delhi
10         Rajeev         New-Delhi
11         Shailesh      Delhi
12         Shreyas      New-Delhi

If I give location as Mumbai, Pune and Delhi i.e. location based pattern matching (LIKE operator) then
query should retrieve record as Sanjeev,Rajeev and Shailesh i.e.
all employees those are present in all given locations (Mumbai, Pune and Delhi).
query shouldn't retrieve Ramesh, Shreyas because they are not present in all given location.

I tried with "OR" operator but it did not work.

Could any one help me in above.

Thanking in advance
Sanjeev Received on Fri Jan 09 2009 - 06:08:03 CST

Original text of this message