SQL SERVER AVG AVERAGE AGGREGATE FORMULA
--alright viewers, today we will look at the average list price in the products table
--we are using SQL Server 2012 in SSMS
--let us begin
select AVG(P.ListPrice)
from AdventureWorksDW2012.dbo.DimProduct as P;
--as you can see the average list price in the product table is 747.6617.
--now let's have a look at what the list price values are for a unique set of list prices
--distinct means select a unique list price
select distinct P.ListPrice
from AdventureWorksDW2012.dbo.DimProduct as P;
--that is it.
No comments:
Post a Comment