Fórum Erro SQL com Firebird 1.5 #264273
05/01/2005
0
Tenho um select que esta dando o seguinte erro:
<b>Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).</b>
===============================================
select a.tipavlcod, (avg(a.avanot) *
(select t.avapes from tipavaliaturma t
where t.trmcod = a.trmcod
and t.discod = a.discod
and t.tipavlcod = a.tipavlcod
) ) as Media
from avaliaturma a
where a.trmcod = :Turma
and a.discod = :Dis
and a.mtrnum = :Matr
group by a.tipavlcod
===============================================
Agradeço se alguém puder Ajudar-me.[/b]
<b>Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).</b>
===============================================
select a.tipavlcod, (avg(a.avanot) *
(select t.avapes from tipavaliaturma t
where t.trmcod = a.trmcod
and t.discod = a.discod
and t.tipavlcod = a.tipavlcod
) ) as Media
from avaliaturma a
where a.trmcod = :Turma
and a.discod = :Dis
and a.mtrnum = :Matr
group by a.tipavlcod
===============================================
Agradeço se alguém puder Ajudar-me.[/b]
Mkoch
Curtir tópico
+ 0
Responder
Posts
05/01/2005
Sremulador
seu problema esta aqui
select a.tipavlcod, (avg(a.avanot) *
[b:3a0d3b1179](select t.avapes from tipavaliaturma t
where t.trmcod = a.trmcod
and t.discod = a.discod
and t.tipavlcod = a.tipavlcod
) ) as Media [/b:3a0d3b1179]from avaliaturma a
where a.trmcod = :Turma
and a.discod = :Dis
and a.mtrnum = :Matr
group by a.tipavlcod
tente fazer isso
select a.tipavlcod, (avg(a.avanot) *
[b:3a0d3b1179](select t.avapes from tipavaliaturma t
where t.trmcod = a.trmcod
and t.discod = a.discod
and t.tipavlcod = a.tipavlcod
) ) as Media [/b:3a0d3b1179]from avaliaturma a
where a.trmcod = :Turma
and a.discod = :Dis
and a.mtrnum = :Matr
group by a.tipavlcod, Media
select a.tipavlcod, (avg(a.avanot) *
[b:3a0d3b1179](select t.avapes from tipavaliaturma t
where t.trmcod = a.trmcod
and t.discod = a.discod
and t.tipavlcod = a.tipavlcod
) ) as Media [/b:3a0d3b1179]from avaliaturma a
where a.trmcod = :Turma
and a.discod = :Dis
and a.mtrnum = :Matr
group by a.tipavlcod
tente fazer isso
select a.tipavlcod, (avg(a.avanot) *
[b:3a0d3b1179](select t.avapes from tipavaliaturma t
where t.trmcod = a.trmcod
and t.discod = a.discod
and t.tipavlcod = a.tipavlcod
) ) as Media [/b:3a0d3b1179]from avaliaturma a
where a.trmcod = :Turma
and a.discod = :Dis
and a.mtrnum = :Matr
group by a.tipavlcod, Media
Responder
Gostei + 0
05/01/2005
Mkoch
Já temtei assim como você sugeriu mas da o erro
´Column does not belong to referenced table.
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
MEDIA.
At line 38, column 23.´
´Column does not belong to referenced table.
Dynamic SQL Error.
SQL error code = -206.
Column unknown.
MEDIA.
At line 38, column 23.´
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)