I\'m learning SQL/dbms and using Postgres. I want to return rows that both have a certain value in a certain column. For example in tables Carpets and Curtain
Carpets
Curtain
These both query will give you result which you want....
SELECT Carperts.id FROM Carpets INNER JOIN Curtains ON Carpets.colour = Curtains.colour and colour = 'light yellow'; SELECT Carperts.id FROM Carpets INNER JOIN Curtains ON Carpets.colour = Curtains.colour WHERE colour = 'light yellow';