Conditionally sum a column based on a mod result I have the following query:

SELECT y.datamov,
       y.n_conta,
       y.sinal,
       y.valor,
       y.qtde,
       a.nome,
       '',
       0,
       a.lrdarc
FROM (
    SELECT k.datamov,
        k.n_conta,
        k.sinal,
        k.qtde,
        sum(k.total) AS valor
    FROM (
        SELECT DATE (b.dt_normal) AS datamov,
            b.historico,
            a.obs,
            a.total,
            a.qtde,
            b.sinal,
            c.nome,
            a.n_conta
        FROM caixa.rtitens a
        LEFT JOIN caixa.rtlan b ON (b.numero = a.n_lan)
        LEFT JOIN caixa.rtctares c ON (c.numero = a.n_conta)
        WHERE DATE (b.dt_normal) BETWEEN DATE ('2010-02-13') AND DATE ('2010-02-20')
            AND c.lrdarc != 0
            AND b.sinal = 'E'
        ORDER BY 1, 7, 5
        ) k
    GROUP BY 1, 2, 3, 4
    ORDER BY 1, 2, 3
    ) y
LEFT JOIN caixa.rtctares a ON (a.numero = y.n_conta)
ORDER BY 1, 2, 3


Which returns results like these:


My problem is: I need to conditionally "merge" two rows into one when the mod of the a.lrdarc is equal to 1. If this condition is not filled (ie the mod is 0), then it should show the column without doing anything. I've been trying to do this for a while and until now I have no idea on how to solve this. What can I do?

EDIT: I want something like this:
As my boss stated, all I had to do was edit the inner statements instead of trying to manipulate the results on the outer query. We managed to do what I needed with this:

SELECT  y.datamov, 
    y.n_conta,
    y.sinal,
    y.valor,
    a.nome,
    '',
    0,
    y.lrdarc,
    y.quantidade
FROM (
    SELECT k.datamov,
        k.n_conta,
        k.sinal,
        sum(k.qtde_valida) as quantidade,
        k.grupo as lrdarc,
        sum(k.total) AS valor
    FROM (
        SELECT DATE (b.dt_normal) AS datamov,
               b.historico,
               a.obs,
               a.total,
               b.sinal,
               c.nome,
               a.n_conta,
               c.lrdarc,
               case when mod(c.lrdarc, 2) !=0 then
                    a.qtde
               else
                    0
               end as qtde_valida,
               trunc(c.lrdarc / 10) as grupo
        FROM caixa.rtitens a
        LEFT JOIN caixa.rtlan b ON (b.numero = a.n_lan)
        LEFT JOIN caixa.rtctares c ON (c.numero = a.n_conta)
        WHERE DATE (b.dt_normal) BETWEEN DATE ('2010-02-13') AND DATE ('2010-02-20')
        AND c.lrdarc != 0 AND b.sinal = 'E'
        ORDER BY 1, 7, 5
        ) k
    GROUP BY 1, 2, 3, 5
    ORDER BY 1, 2, 3
    ) y
LEFT JOIN caixa.rtctares a ON (a.numero = y.n_conta)
ORDER BY 1, 2, 3


Note that the select from the most inner query, where we've added this:

...
c.lrdarc,
case when mod(c.lrdarc, 2) !=0 then
     a.qtde
else
     0
end as qtde_valida,
trunc(c.lrdarc / 10) as grupo


This solved the problem.