Answer the question
In order to leave comments, you need to log in
How to find owners who own more than one apartment in the same building?
Is there a table on how to find owners who own more than one apartment in the same building?
id|flat_num|house_id|owner_id|
1|12 |2 |1 |
2|22 |3 |3 |
3|10 |3 |3 |
4|30 |1 |2 |
5|12 |2 |4 |
6|22 |3 |4 |
Answer the question
In order to leave comments, you need to log in
SELECT owner_id FROM t1
GROUP BY owner_id, house_id
HAVING count(owner_id, house_id) > 1;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question