Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
with cte as ( select -1 as kli_kliniknr, max(m.MeasurementDate) as MeasurementDate, SUM(NumberOfMeasurements) as NumberOfMeasurements, SUM(NumberOfMen) as NumberOfMen, SUM(NumberOfWomen) as NumberOfWomen, -- What is the difference between these two rows? avg( Q1 * NumberOfMeasurements / NumberOfMeasurements) as Q1, sum( Q1 * NumberOfMeasurements) / sum(NumberOfMeasurements) as Q1x, from [BPSD].[dbo].[MeasurementStatisticsPerUnit] m group by m.MeasurementDate ) select * from cte ;
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|MS SQL Server select from Sub Table||14||41|
|SQL Database Restore 2008 R2||1||27|
|creating a permanent table from the results of a select statement in sql server 2016||5||31|