Which stores sold the most turkey dinners during the Red Carpet Closeout promotion by day?
Displays all stores with sales for the turkey dinner each day but I only want to display the store with the most sales for each day. So my result should only be displaying 7 results with the dollar amount for each day as well as which store.
SELECT name,description "Description", promotion_name "Promotion Name",
TO_CHAR(SUM(unit_sales), 'L99G999D99MI') AS "Unit Sales", day_of_week "Day"
WHERE product_key = 3
AND promotion_key = 2
GROUP BY day_of_week, name, description, promotion_name
ORDER BY (SUM(unit_sales))DESC, name
What am I missing? Thanks for any and all help.
Welcome to the forums but you have posted you SQL question in the SQL Developer forum which, as the forum title says, is NOT for general SQL/PLSQL questions.
Please mark this question ANSWERED and repost it in the SQL and PL/SQL forum SQL and PL/SQL
When you post provide your 4 digit Oracle version.
You also need to post the results your query is giving and explain why those results are wrong.