I'm having problem with a SUm, because I need a Sum after a Group by.
This is the query:
SELECT isnull (sum(overtime),0) as overtime, Operatore, Descrizione, Datalog, Ip, IpPc, NomePc from lst_activitiLog l inner join lst_activitiMachine m on l.IpPc=m.Ip where m.Operatore = '1002408' and overtime is not null and convert(varchar,l.datalog, 112) = '20151002' group by Operatore, Descrizione, Datalog, Ip, IpPc, NomePc order by Operatore,Datalog
the result is:
I need a subquery which summarize the first column 113 +31 = 144.. I'm using MS SQL 2000 and I can't use Over, so I need another way to do this sum. Help me!!!