Skip to content

Instantly share code, notes, and snippets.

@ninnemana
Created April 8, 2015 17:56
Show Gist options
  • Select an option

  • Save ninnemana/6569274e8110be9060d6 to your computer and use it in GitHub Desktop.

Select an option

Save ninnemana/6569274e8110be9060d6 to your computer and use it in GitHub Desktop.
select bv.YearID, ma.MakeName, mo.ModelName, s.SubmodelName from Vehicle as v
join BaseVehicle as bv on v.BaseVehicleID = bv.BaseVehicleID
join Make as ma on bv.MakeID = ma.MakeID
join Model as mo on bv.ModelID = mo.ModelID
left join Submodel as s on v.SubmodelID = s.SubmodelID
where ma.MakeName = 'Suzuki' && bv.YearID = 2011
group by mo.ModelName
order by bv.YearID, mo.ModelName;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment