Created
May 7, 2014 20:12
-
-
Save mgreenly/89d2b7f1126c016ee587 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 | |
count(*) | |
from | |
serial_numbers | |
join boats on | |
boats.id = serial_numbers.boat_id | |
join boat_sizes on | |
boat_sizes.id = boats.boat_size_id | |
join chassis on | |
chassis.id = boats.chassis_id | |
where | |
serial_numbers.value >= '82000' | |
and (not boats.cancelled) | |
and (not boats.hold) | |
group by | |
chassis.name, boat_sizes.name | |
order by | |
chassis.name asc, | |
boat_sizes.name asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment