I need to add a series of elements that are in fact the result of a sum, I will try to explain myself as best as possible.
I have the following query:
select distinct
cp.descripcion,
cp.idSysCPPuestos,
em.nombreLargo
,sum(CAST(em.sueldoDiario AS DECIMAL(18, 4)))+sum(CAST(em.sueldoIntegrado AS DECIMAL(18, 4))) [Total]
from
sysCPEmpleados em
inner join sysCPCentroCosto cc on
em.idSysCPCentroCosto = cc.idSysCPCentroCosto
inner join sysCPPuestos cp on
em.idSysCPPuestos = cp.idSysCPPuestos
where cc.idSysCPCentroCosto = 'SBIB15C'
group by
cp.descripcion,
cp.idSysCPPuestos,
em.nombreLargo
,em.idSysCPCentroCosto
Return the following:
The point is that I need to get the total data by its idSysCPPuestos , that is the sum of all those total is to get something like:
AFANDORA | GB022 | x.xx
ASSISTANT | GB025 | x.xx
Avoid repeating that I only showed the total of the sums "suamdas entre susi".