Invalid Column Reference

Firebird

20/02/2004

Olá! A sequinte SQL está apresentando o erro: Invalid Column Reference. Se eu retirar os campos ´Sum´ a SQL funciona perfeitamente.

Alguém poderia me dar uma luz?

SQL:

select t1.Data,t2.n1,sum(t1.h2) from
mapa1 t1, pleites t2 where
t1.data between ´02/01/04´ and ´02/29/04´ and
t1.dieta=t2.1
union
select t3.Data,t4.n2,sum(t1.frasco_9h) from
mapa2 t3, pdietas t4 where
t3.data between ´02/01/04´ and ´02/29/04´ and
t3.dieta=t4.n2[/img]


Delphi32

Delphi32

Curtidas 0

Respostas

Sremulador

Sremulador

20/02/2004

Tente assim

select t1.Data,t2.n1,sum(t1.h2) from
mapa1 t1, pleites t2 where
t1.data between ´02/01/04´ and ´02/29/04´ and
t1.dieta=t2.1
group by t1.Data,t2.n1
union
select t3.Data,t4.n2,sum(t1.frasco_9h) from
mapa2 t3, pdietas t4 where
t3.data between ´02/01/04´ and ´02/29/04´ and
t3.dieta=t4.n2
group by t1.Data,t2.n1


GOSTEI 0
Delphi32

Delphi32

20/02/2004

funcionou perfeitamente!


GOSTEI 0
Sremulador

Sremulador

20/02/2004

select t1.Data,t2.n1,sum(t1.h2) from
mapa1 t1, pleites t2 where
t1.data between ´02/01/04´ and ´02/29/04´ and
t1.dieta=t2.1
order by t2.n1
group by t1.Data,t2.n1
union
select t3.Data,t4.n2,sum(t1.frasco_9h) from
mapa2 t3, pdietas t4 where
t3.data between ´02/01/04´ and ´02/29/04´ and
t3.dieta=t4.n2
order by t2.n1
group by t1.Data,t2.n1


GOSTEI 0
POSTAR