I have the following table,
id idAttribute valueAttribute idPiece
1 9 '2048' 10
2 18 'DDR3' 10
3 9 '2048' 11
4 18 'DDR3' 12
When doing this query:
SELECT *
FROM tb_inventary_report
WHERE (idAtribute = 9 AND valueAtribute = '2048')
OR (idAtribute = 18 AND valueAtribute = 'DDR3')
I am returning records 1, 2, 3 and 4, however I want to return only 1 and 2 because they have the same idPiece, but I can not inform the idPiece, ie, idPiece has to be Iqual between the ORs that i pass
How can I do to return only the 1 and 2?