The problem appears when I do a query on a couple of columns (of a survey) because I want the output point to a single ID, instead of the query divides the output for each response of that the id provides.
Original query
select distinct _PanelistaId_,
(case when cancl_seg_vida_mr = '4' then '1' end) as cancl_seg_vida_mr,
(case when prop_seg_med_mr = '5' then '1' end) as prop_seg_med_mr
FROM [NQ_Mexico].[dbo].[tabla_sr_mr_values]
where _PanelistaId_ = '100177354'
group by _PanelistaId_, cancl_seg_vida_mr, prop_seg_med_mr
the outpus is :
_PanelistaId_ cancl_seg_vida_mr prop_seg_med_mr
100177354 NULL NULL
100177354 NULL 1
100177354 1 NULL
But the output I want is this one:
_PanelistaId_ cancl_seg_vida_mr prop_seg_med_mr
100177354 1 1