Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DROP TABLE IF EXISTS #Test CREATE TABLE #Test ( ID INT IDENTITY(1, 1) PRIMARY KEY , FruitName VARCHAR(100) , SalesAmount MONEY , TransactionDate DATETIME )
DROP TABLE IF EXISTS #Test CREATE TABLE #Test ( ID INT IDENTITY(1, 1) PRIMARY KEY , FruitName VARCHAR(100) , SalesAmount MONEY , TransactionDate DATETIME ) INSERT #Test VALUES ('Banana',10,'20220512') , (NULL,5,'20220401') , ('Orange',15,'20221211'), ('Apple',20,'20220312') SELECT t.FruitName AS [Fruit Name] , t.SalesAmount AS [Sales ] , SUM(t.SalesAmount) OVER () AS [Total] FROM #Test t WHERE t.FruitName NOT IN ('Apple',NULL)
Explain in detail and also add joins to the table of the left column
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started