Posted by stockblaster on 01/15/06 09:59
I tried to use this query-
SELECT TOP 4 OrderID FROM TABLE1 WHERE exists (SELECT * From TABLE2
where @UserId=TABLE2.UserID)
But this query shows me the all 4 OrderID's if it finds the USERID in
TABLE2..
What i want to return is only which OrderID'S existes in TABLE2 for the
specific user.
if i have in TABLE1:
OrderID
1
2
3
4
TABLE2:
OrderID UserId
1 1001
2 1002
I want it to return only "2" if the INPUT Parameter of @UserID is 1002
Navigation:
[Reply to this message]
|