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
Since the results are for two disjoint tables, you actually want a union instead:
select id, 'curtains' as source from curtains where color = 'lightyellow'
union
select id, 'carpets' as source from carpets where color = 'lightyellow'
Regarding joins, learn them all together. They are just slight variations of each other.