Sunday, 25 August 2013

duplicate results from mysql statement

duplicate results from mysql statement

I have this select query
SELECT * FROM Category cgy, Product pd, Transactions tr WHERE cgy.CatID =
1 AND tr.payment_status = 'Completed' AND pd.pid=cgy.pid
with that query I am only meant to get 1 result back but unfortunately I
am getting 2 of the same result. I don't understand why because I have
join both the primary key and foreign key.
Transactions doesn't have any key related to any of those tables

No comments:

Post a Comment