Skip to main content

developerWorks >  Information Management  >  Forums  >  IBM DB2 for Linux, Unix, and Windows Forum  >  developerWorks

SQL and Xquery tutorial for IBM Db2 and help Part 5    Point your RSS reader here for a feed of the latest messages in this thread


Tags for this thread: 

     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 0 - Pages: 1
K318wilcoxa

Posts: 1
Registered: Jan 28, 2009 02:38:39 PM
SQL and Xquery tutorial for IBM Db2 and help Part 5
Posted: Nov 04, 2009 07:29:07 PM
 
Click to report abuse...   Click to reply to this thread Reply
Attachment Aroma Data.zip (1.1 MB)
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
Help

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.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums