Last active
December 14, 2015 00:38
-
-
Save thePunderWoman/4999937 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
use CurtDev; | |
select bv.YearID, ma.MakeName, mo.ModelName, sm.SubmodelName, | |
(select GROUP_CONCAT(ca.value) as combined | |
from VehicleConfigAttribute vca | |
inner join ConfigAttribute ca ON vca.AttributeID = ca.ID | |
where vca.ID in (select vca1.AttributeID FROM VehicleConfigAttribute vca1 where vca1.VehicleConfigID = v.ConfigID) | |
) as Config | |
from BaseVehicle bv | |
join vcdb_Vehicle v on bv.ID = v.BaseVehicleID | |
join vcdb_VehiclePart vp on v.ID = vp.VehicleID | |
left join Submodel sm on v.SubModelID = sm.ID | |
left join vcdb_Make ma on bv.MakeID = ma.ID | |
left join vcdb_Model mo on bv.ModelID = mo.ID | |
where vp.PartNumber = 120363 | |
order by bv.YearID desc, ma.MakeName, mo.ModelName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment