Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select I.store_nbr, max(petfood)
- from(
- select sum(S.item_quantity) as petfood
- from((store_information as I join store_visits as V on I.store_nbr=V.store_nbr
- join item_scan as S on S.visit_nbr=V.visit_nbr)
- join item_desc as D on D.item_nbr=S.item_nbr)
- )
- where I.state='OH' and D.category_nbr='8'
- group by I.store_nbr
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement