I have 2 tables.
Table Matches
id | TeamA | TeamB
--------------
1 | Barça | Madrid
2 | Valencia | Depotivo
Table Payments
idMatch | User | Quantity
---------------------------
1 | Me | 50
2 | Me | 100
Then in one query I want to get TeamA, TeamB, User and Quantity if they have same id.
I've tried this but it fails.
SELECT TeamA, TeamB FROM Matches WHERE id IN (SELECT idMatch, TeamA, TeamB FROM Payments)