Olá Pessoal,

Tenho o seguinte sentença:

select setor, 
sum(case conta when 5150 then valor else 0 end) as Receita1,
sum(case conta when 5900 then valor else 0 end) as Receita2,
sum (valor) as TotReceita
from receitas
where
data  between '20120201' and '20121228' and
setor between 1 and 9999
group by setor

que retorna:
Setor - Receita1- Receita2
6         230.00        450.00
7        600.00         780.00

Preciso retornar no em cada somatorio o nome da CONTA ao inves de um nome ALIAS.
Ex: RETONARIA:
Setor - VendasExterna - VendaInterna
6                     230.00             450.00
7                     600.00              780.00

Alguem tem alguma dica ?

Obrigado.

Paulo.
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a