“If you are planning for a year, sow rice; if you are planning for a decade, plant trees; if you are planning for a lifetime, educate people.”
- Chinese Proverb
SELECT Product_ID ,Sale_Date , Daily_Sales,
(ORDER BY Product_ID, Sale_Date) AS Seq_Number
FROM Sales_Table WHERE Product_ID IN (1000, 2000) ;
The ROW_NUMBER Keyword caused Seq_Number to increase sequentially. Notice that this does NOT have a Rows Unbounded Preceding, and it still works! There is never anything in the parenthesis of the Row_Number.
In the example above, we are ...