Skip to content

Instantly share code, notes, and snippets.

@thePunderWoman
Last active December 14, 2015 00:38
Show Gist options
  • Save thePunderWoman/4999937 to your computer and use it in GitHub Desktop.
Save thePunderWoman/4999937 to your computer and use it in GitHub Desktop.
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