select 
(select asodocumento from sfet_asociado where asociado_id = ssmasociado) as cedula	,
(select asonombres from sfet_asociado where asociado_id = ssmasociado) as nombres	,
(select asoapellidos from sfet_asociado where asociado_id = ssmasociado) as apellidos	,
(select carnombre from sfet_cargoasociado where cargoasociado_id = ssmcargoasociado) as cargo	,
	
sum(ssmcompensacionbasica) as sueldo_basico,
sum(ssmtotalingresoextra) as horas_extras,
sum(ssmtotalrecargosordinarios) as  recargos, 
sum(ssmprecioinca100) as incapacidad_general,
sum(ssmprecioinca66) as incapacidad_laboral,
sum(ssmpreciomaternidad + ssmpreciopaternidad) as maternidad,
sum(ssmprecioluto + ssmpreciopermisoremunerado + ssmpreciocalamidad) as permisos,
sum(ssmotrosingresossalariales + ssmingresossalarialesanticipados) as otros_ingresos_salariales,
sum(ssmdiassalariales) as dias
from sfet_sabanasubmensual 
where
	ssmsubmes in (select nominames_id from sfet_nominames where nomcodigoperiodo >= 201701 and nomcodigoperiodo <= 201706)
group by ssmasociado