How to do SUM() but with some rules to follow?
I think you can differentiate this SUM's using a SUM(CASE) statement:

select sum(case when vit_codigotiposexames = 21 
                then vit_codigotiposexames 
                else 0 end) Cadaverico,
       sum(case when vit_codigotiposexames &lt;&gt; 21 
                then vit_codigotiposexames 
                else 0 end) CorpoDelito
from   tb_vitima;


I've set up an example:




create table tb_vitima (id int identity, vit_codigotiposexames int);
insert into tb_vitima values (2),(5),(10),(11),(21),(21),(10),(23);

select sum(case when vit_codigotiposexames = 21 then vit_codigotiposexames else 0 end) Cadaverico,
       sum(case when vit_codigotiposexames &lt;&gt; 21 then vit_codigotiposexames else 0 end) CorpoDelito
from   tb_vitima;
GO



Cadaverico | CorpoDelito
---------: | ----------:
        42 |          61



dbfiddle here