Autor
Mensagem
No seguinte código
ocorre o seguinte erro:
o que tem de errado no meu SQL, quando executo cada select individualmente ele rola na boa!
Obrigado
#Código
select
Janeiro as mes,
sum(cast (ne.total as numeric(10,2))) as Total_Vendas
from notas_emitidas ne
where
extract (month from ne.data_emissao)
= 1
and extract (year from ne.data_emissao)
= :Ano
union all
select
Fevereiro as mes,
sum(cast (ne.total as numeric(10,2))) as Total_Vendas
from notas_emitidas ne
where
extract (month from ne.data_emissao)
= 2
and extract (year from ne.data_emissao)
= :Ano
union all
select
Março as mes,
sum(cast (ne.total as numeric(10,2))) as Total_Vendas
from notas_emitidas ne
where
extract (month from ne.data_emissao)
= 3
and extract (year from ne.data_emissao)
= :Ano
group by 1, 2
Janeiro as mes,
sum(cast (ne.total as numeric(10,2))) as Total_Vendas
from notas_emitidas ne
where
extract (month from ne.data_emissao)
= 1
and extract (year from ne.data_emissao)
= :Ano
union all
select
Fevereiro as mes,
sum(cast (ne.total as numeric(10,2))) as Total_Vendas
from notas_emitidas ne
where
extract (month from ne.data_emissao)
= 2
and extract (year from ne.data_emissao)
= :Ano
union all
select
Março as mes,
sum(cast (ne.total as numeric(10,2))) as Total_Vendas
from notas_emitidas ne
where
extract (month from ne.data_emissao)
= 3
and extract (year from ne.data_emissao)
= :Ano
group by 1, 2
ocorre o seguinte erro:
Citação:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid command.
Data type unknown.
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Invalid command.
Data type unknown.
o que tem de errado no meu SQL, quando executo cada select individualmente ele rola na boa!
Obrigado







