código es
select customerid, count(campaignid) as T, Convert (varchar, CreatedOn,23) from customerbenefits
where campaignid='6EDBB808-1A91-4B1D-BE1D-27EF15C5D4C7'
and createdon between '2019-09-01' and '2019-10-01'
group by customerid,CreatedOn
having count(campaignid)>1
order by createdon desc
El resultado es
-- id / count /time
--18655680-3B5E-4001-1984-00000000 / 12 /2019-09-30
--18655680-3B5E-4001-1984-00000000 / 7 / 2019-09-30
--18655680-3B5E-4001-1984-00000000 / 6 / 2019-09-30
Quiero resultar tan
-- id / count / time
-- 18655680-3B5E-4001-1984-00000000 / 25/ 2019-09-30
Quiero que agrupa filtrar y suma el tiempo cuenta.
¿Cómo puedo cambiar mi consulta?