I have I rather complex query and need to display a Sum in different ways. Now I'm wondering if the performance improves if you nest the queries in the described way. To me it looks, as if the sum just has to be calculated once? Can I expect the performance to be better?select SUM(tiempo) as time_minutes, CONVERT(varchar(5), dateadd (minute,sum(tiempo),'1900-1-1 0:00'), 114) as time_hours, SUM(time)* 0.95 as time_discountfrom tableSelect tiempo as time_minutes, CONVERT(varchar(5), dateadd (minute,tiempo,'1900-1-1 0:00'), 114) as time_hours, tiempo * 0.95 as time_discountFrom (Select Sum(tiempo) as tiempofrom table)a
regards,Martin