Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a SQL query to find the sum of sales of current row and previous 2 rows in a product group? Sample outcome of the

  1. Write a SQL query to find the sum of sales of current row and previous 2 rows in a product group? Sample outcome of the SQL statement is given below.

PRODUCT_ID QUANTITY CALC_SALES

------------------------------------------------------------

100 25 25

100 16 41

100 12 53

200 20 20

200 15 35

200 14 49

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions