-
-
Save sergii/dd66ad1211a63e57ea630ea267202207 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
* | |
from | |
tables | |
join ( | |
select table_id | |
from books | |
where rating = 1 | |
) as t1 on t1.table_id = tables.table_id | |
join ( | |
select table_id | |
from books | |
where rating = 5 | |
) as t2 on t2.table_id = tables.table_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment