
Ayuda Group by
Publicado por Jhonathan (1 intervención) el 22/07/2015 18:53:18
Buen dia
hice esta consulta:
pero el firebird me regresa el siguiente error:
(can't format message 13:896 -- message file C:\Windows\firebird.msg not found.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).
y no se en donde estoy errando.. De antemando Gracias
hice esta consulta:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
select
hi.id,
(1) as cant,
ar.codigoart,
ar.descrip,
ar.fam,
dta.stockalmacen,
ar.ultcoste,
ar.premecos,
ar.preultcompra,
max (hi.fecha),
case
when HI.tipo='E' then 'Compra'
end as Compra
from articulo ar
left join histalma hi on ar.id = hi.minarticulo
left join detalmac dta on ar.id = dta.rfnarticulo
where
HI.tipo='E'
group by
hi.id
pero el firebird me regresa el siguiente error:
(can't format message 13:896 -- message file C:\Windows\firebird.msg not found.
Dynamic SQL Error.
SQL error code = -104.
Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).
y no se en donde estoy errando.. De antemando Gracias
Valora esta pregunta


0