This is the query I am running. I am getting the correct results except they come in on a different line for each corpstorenum, so i am getting :
Corpstorenum,BuffetYN, deliverybeeryn, dineinbeeryn,saladbar store1,n,n,n,y store1,n,n,y,n store1,n,y,n,n store1,n,n,n,n
instead of:
store1 n,y,y,y
This is my code:
select distinct corpstorenum,
case when storenumbers.storenumber is not null and concept ='buffetAY' then 'Y' else 'n' end as BuffetYN ,
case when storenumbers.storenumber is not null and concept ='Beer' and delivery#>0 then 'Y' else 'n' end as DeliveryBeerYN ,
case when storenumbers.storenumber is not null and concept ='Beer' and dinein#>0 then 'Y' else 'n' end as DineInBeerYN,
case when storenumbers.storenumber is not null and menusize='WithMeal' and dinein#>0 then 'Y'
else 'n' end as SaladBar
from storenumbers
left join prod5219 on storenumbers.storenumber = [Prod5219].store