Created
July 2, 2013 21:21
-
-
Save thePunderWoman/5913262 to your computer and use it in GitHub Desktop.
All vehicles and their count of t-connectors
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 Y.year, M.make, MO.model, S.style, | |
(SELECT COUNT(*) | |
FROM VehiclePart VP | |
INNER JOIN Part P ON VP.partID = P.partID | |
WHERE VP.vehicleID = V.vehicleID AND P.classID = 11) AS tconnectors | |
from Vehicle V | |
INNER JOIN Year Y on V.yearID = Y.yearID | |
INNER JOIN Make M on V.makeID = M.makeID | |
INNER JOIN Model MO on V.modelID = MO.modelID | |
INNER JOIN Style S on V.styleID = S.styleID | |
ORDER BY M.make, MO.model, Y.year, S.style |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment