Join table puzzle...
Hi there, i need help with sql
I have 4 tables,
UserTab(Id, Name, Email, Phone)
ItemTab(ItemId, Type, Item)
relationTab(Id, TransactionId, ItemId, Quantity, ReturnedDate, ReceiverId)
loanTab(Id, TransId, BorrowerId, DateBorrowed, IssuerId, ReceiverId)
I wanna do a search for employee and return the items tht the employee borrowed.
Whats wrong with my sql statement ?
SELECT UserTab.Name, ItemTab.Item
FROM LoanTab INNER JOIN UserTab ON LoanTab.ReceiverId = UserTab.Id
INNER JOIN relationTab ON LoanTab.TransId = relationTab.TransactionId
INNER JOIN ItemTab ON relationTab.ItemId = ItemTab.ItemId
WHERE Name LIKE '%strName%'
I tried doing this in the query analyzer it displayed the fields but no entries..
Pls help, thanks in advance
__________________
Education ruined me
|