Hello, I was having issues with an exercise found in the SQL and Xquery tutorial for IBM Db2. I was working on Section 3 "Using CASE Expressions" and after entering the following query in the command editor no results were populated? This exercise is related to the AromaDB.
"SELECT prod_name, SUM(CASE WHEN store_name = 'Beaches Brew' then dollars else 0 end) AS Beaches,
SUM(CASE WHEN store_name = 'Cupertino Coffee Supply' then dollars else 0 end) AS Cupertino,
SUM(CASE WHEN store_name = 'Roasters, Los Gatos' then dollars else 0 end) AS Roast LG,
SUM(CASE WHEN store_name = 'Java Judy''s' then dollars else 0 end) AS JavaJudy,
SUM(CASE WHEN store_name = 'Instant Coffee' then dollars else 0 end) AS Instant,
FROM aroma.market a, aroma.store b, aroma.period c, aroma.product d, aroma.class e, aroma.sales f
WHERE a.mktkey = b.mktkey
AND b.storekey = f.storekey
AND c.perkey = f.perkey
AND d.classkey = e.classkey
AND d.classkey = f.classkey
AND d.prodkey = f.prodkey
AND region LIKE 'WEST%'
AND year = 2004
AND class_type = 'Pkg_coffee'
GROUP BY prod_name
ORDER BY prod_name;
"
Any help will be appreciated. Thank You Abraham W
Tags
Use the search field to
find all types of content in My developerWorks with that tag.
Use the slider bar to see more or fewer tags.
Popular tags shows the top tags for this particular type of content or application that you're viewing.
My tags shows your tags for this particular type of content or application that
you're viewing.