Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with rc(model,make,manufacturer,yr,recallid,compdesc,potential) as(
- select modelname,makename,manufacturer,yeartxt,rmy.recallid,compdesc,potential
- from recall.model mo
- join recall.make ma on mo.makeid=ma.makeid
- join recall.recall_modelyear rmy on rmy.modelid = mo.modelid
- join recall.recall r on rmy.recallid = r.recallid
- )
- select manufacturer, yr, count(*) as totalRecall, max(potential) as biggestRecall from rc
- group by manufacturer, yr
- having count(*) >= 10 and max(potential) < 2000000
- order by totalrecall desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement