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

 
 
Herramientas Buscar en Tema Desplegado
  #7  
Antiguo 13-07-2012
Avatar de guillotmarc
guillotmarc guillotmarc is offline
Miembro
 
Registrado: may 2003
Ubicación: Huelva
Posts: 2.638
Poder: 24
guillotmarc Va por buen camino
Hola Josep.

Cita:
Empezado por jafera Ver Mensaje
A ver si avanzo algo he hecho esto y me salen los datos correctos:
Código SQL [-]
select ID_REBUT, ID_ARBIT1 
from RE0010DG 
        INNER JOIN RE0001 ON ID_ARBIT1 = 1 
GROUP BY ID_ARBIT1, ID_REBUT


Pero solo para una de las columnas de la tabla, ID_ARBIT1, puedo añadir más INNER o algo para que me busque en las otra siete columnas?

Tengo que hacer un select para cada una?.

Estoy más liado que la pata un romano.

Gracias

Josep
Para añadir las otras siete columnas puedes usar la cláusula UNION, que permite unir varias consultas en una sola.

Es decir :

Código SQL [-]
  select id_arbit1, id_rebut, import_1, sobres_1, import_km_1, campionat1, feiner1, dos_sectors1, total_a1 from re0010dg
  where id_arbit1 = 1
UNION
  select id_arbit2, id_rebut, import_2, sobres_2, import_km_2, campionat2, feiner2, dos_sectors2, total_a2 from re0010dg
  where id_arbit2 = 1
UNION
  select id_arbit3, id_rebut, import_3, sobres_3, import_km_3, campionat3, feiner3, dos_sectors3, total_a3 from re0010dg
  where id_arbit3 = 1
UNION
  select id_arbit4, id_rebut, import_4, sobres_4, import_km_4, campionat4, feiner4, dos_sectors4, total_a4 from re0010dg
  where id_arbit4 = 1
UNION
  select id_arbit5, id_rebut, import_5, sobres_5, import_km_5, campionat5, feiner5, dos_sectors5, total_a5 from re0010dg
  where id_arbit5 = 1
UNION
  select id_arbit6, id_rebut, import_6, sobres_6, import_km_6, campionat6, feiner6, dos_sectors6, total_a6 from re0010dg
  where id_arbit6 = 1
UNION
  select id_arbit7, id_rebut, import_7, sobres_7, import_km_7, campionat7, feiner7, dos_sectors7, total_a7 from re0010dg
  where id_arbit7 = 1
UNION
  select id_arbit8, id_rebut, import_8, sobres_8, import_km_8, campionat8, feiner8, dos_sectors8, total_a8 from re0010dg
  where id_arbit8 = 1

Salut
__________________
Marc Guillot (Hi ha 10 tipus de persones, els que saben binari i els que no).
Responder Con Cita
 



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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Como agrupar datos por semanas flystar MySQL 1 06-06-2008 03:52:32
Problema en agrupar datos en QuickReport enecumene Impresión 15 07-11-2007 18:02:52
Agrupar o no según u parametro de una tabla auxiliar apicito SQL 8 27-12-2004 23:44:41
Agrupar datos castroruiz2001 SQL 3 04-07-2003 18:14:06
Como agrupar datos de una tabla dabas Impresión 1 05-06-2003 16:20:47


La franja horaria es GMT +2. Ahora son las 18:44:50.


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