Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Firebird e Interbase
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 26-02-2005
IVAND IVAND is offline
Miembro
 
Registrado: may 2003
Ubicación: ECUADOR
Posts: 523
Poder: 21
IVAND Va por buen camino
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
__________________
IVAND
Responder Con Cita
  #2  
Antiguo 26-02-2005
samantha jones samantha jones is offline
Miembro
 
Registrado: ago 2004
Posts: 46
Poder: 0
samantha jones Va por buen camino
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
Responder Con Cita
  #3  
Antiguo 26-02-2005
IVAND IVAND is offline
Miembro
 
Registrado: may 2003
Ubicación: ECUADOR
Posts: 523
Poder: 21
IVAND Va por buen camino
Gracias Samantha

Probare , i te comento

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

Gracias
__________________
IVAND
Responder Con Cita
  #4  
Antiguo 27-02-2005
CCCP CCCP is offline
Miembro
 
Registrado: dic 2004
Ubicación: Barcelona
Posts: 38
Poder: 0
CCCP Va por buen camino
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
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 07:37:19.


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
Copyright 1996-2007 Club Delphi