Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.
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.
Join the community of 500,000 technology professionals and ask your questions.