I have a SQL server query which I am trying to achieve but am struggling to find the right words to describe it to look on MSDN. What I have is a table of data and a table of users. I want to create a loop that for each user in dbo.Users to count the records in dbo.Data where the user is the NOT current user in loop, but is a user listed in dbo.Users.

ie. 

```
SELECT COUNT(Records) 
FROM dbo.Data 
WHERE User <> 'ajones' AND (User = 'jbloggs' OR User ='jdoe')

```

(Where ajones is the current user and jbloggs and jdoe are users listed in dbo.Users).

So the "OR" expression will have every single user other than the user it is searching for, that exists in dbo.Users 

I can't do WHERE <> 'ajones' (the current user) because there are many users in the dbo.Data table, but only some those users appear in dbo.Users.

Does this make sense? Some pseudo code:

```
FOR EACH User in dbo.Users
    SELECT COUNT(Records) 
    FROM dbo.Data 
    WHERE User <> CurrentUser AND User IN dbo.Users
Loop

```

What would be the best way to achieve this kind of query?