Created
August 8, 2017 13:53
-
-
Save gabidavila/1dfa8cb29c3788bdecdbdde947874c4f to your computer and use it in GitHub Desktop.
This file contains 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 `boats`.* | |
FROM `boats` | |
INNER JOIN `boat_classifications` | |
ON `boat_classifications`.`boat_id` = `boats`.`id` | |
INNER JOIN `classifications` | |
ON `classifications`.`id` = `boat_classifications`.`classification_id` | |
GROUP BY `boats`.`id` | |
HAVING count(classifications.id) = 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment