Hey,
Obviously from the title, I need a little help with a query.

I have 2 tables. One is a favorites that will look up into another.

So in the favorites table I have 3 fields. UserName, ClientID, and timestamp. My stored procedure gets the username and gets the top15 entries in the table with the passed in username.

This gives me the clientid (the favorites for that user if you will). Now I need to get all the other fields for that clientid passed into another select statement. How can this be done.

So far I have:

SELECT top 15*
FROM Favorites
WHERE username = @UserName
order by Timestamp DESC

Now I need to pass is clientID from that select and get back

Select * from Clients
Where Clients.ClientID IS IN (the first select's clientID)

Thanks,