Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Firebird e Interbase (https://www.clubdelphi.com/foros/forumdisplay.php?f=19)
-   -   invalid expression in the select .... (https://www.clubdelphi.com/foros/showthread.php?t=18901)

IVAND 26-02-2005 00:49:49

invalid expression in the select ....
 
hola a todos

Trabajo con firebird 1 ahora me estoy cambiando a firebird 1.5 pero he tenido algunos inconvenientes entre ellos el siguiente

Código:

select c.key_cab_fac,
 (Select sum(t2.total)
  From form_pago t2
  Where t2.key_cab_fac=t1.key_cab_fac
  And t2.cod_pago=101) as cheq
From cab_fac c , form_pago t1
Where c.estado='T'
And c.key_cab_fac=t1.key_cab_fac
Group by c.key_cab_fac

Este mismo query funciona en Firebird 1 y en firebird 1.5 no me da el siguiente mensaje

Invalid expression in the select list (not contained in either an aggregate function on the GROUP BY clause)

De antemano Gracias

samantha jones 26-02-2005 02:17:40

solo por curiosidad

tampoco funciona asi?

select c.key_cab_fac, sum(Select (t2.total)
From form_pago t2
Where t2.key_cab_fac=t1.key_cab_fac
And t2.cod_pago=101) as cheq
From cab_fac c , form_pago t1
Where c.estado='T'
And c.key_cab_fac=t1.key_cab_fac
Group by c.key_cab_fac

Saludos

IVAND 26-02-2005 18:07:03

Gracias Samantha

Probare , i te comento

El objetivo de esta consulta o querys es de hacer las filas a columnas

Gracias

CCCP 27-02-2005 01:52:12

Cita:

Empezado por IVAND
hola a todos

Trabajo con firebird 1 ahora me estoy cambiando a firebird 1.5 pero he tenido algunos inconvenientes entre ellos el siguiente

Código:

select c.key_cab_fac,
(Select sum(t2.total)
From form_pago t2
Where t2.key_cab_fac=t1.key_cab_fac
And t2.cod_pago=101) as cheq
From cab_fac c , form_pago t1
Where c.estado='T'
And c.key_cab_fac=t1.key_cab_fac
Group by c.key_cab_fac

Este mismo query funciona en Firebird 1 y en firebird 1.5 no me da el siguiente mensaje

Invalid expression in the select list (not contained in either an aggregate function on the GROUP BY clause)

De antemano Gracias

Pruebalo asi
Código:

select c.key_cab_fac,
  (sum(t2.total)) as cheq
From cab_fac c
join form_pago t1 on c.key_cab_fac=t1.key_cab_fac
join form_pago t2 on t2.key_cab_fac=t1.key_cab_fac and  t2.cod_pago=101
Where c.estado='T'
Group by c.key_cab_fac



La franja horaria es GMT +2. Ahora son las 10:37:34.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi