Tuesday, 6 August 2013

SQL Query keeps showing duplicates

SQL Query keeps showing duplicates

Im trying to execute an SQL query in oracle to display the item name and
return date of that item for a specific customer, it works however it then
lists every single item along with the return date when he actually has
only one item, I want to know what im doing wrong and why there are loads
of values being generated my code i used is as follows:
SELECT items.itemname, CustEquipment.ReturnDate FROM items, CustEquipment
INNER JOIN Customers ON CustEquipment.customerID=customers.customerID
WHERE customers.firstname='Martin';
Any help would be much appreciated, P.S. anyway of entering the customers
firstname/lastname after entering the query?

No comments:

Post a Comment