Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Tablas planas
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-04-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 18
richy08 Va por buen camino
Ayuda con un Query en access

este es mi query

INSERT INTO MASTER ( MODELO, MARCA, DESCRIPCION, Precio, [PRECIO PUBLICO], Type, [Size], supplier, erate )
SELECT MASTER1.MODELO, MASTER1.MARCA, MASTER1.DESCRIPCION, MASTER1.Precio, MASTER1.[PRECIO PUBLICO], MASTER1.Type, MASTER1.Size, MASTER1.supplier, MASTER1.erate
FROM MASTER1;

pero no se como indicarle que solo me inserte los registros que estan en MASTER1 y no aparecen en MASTER, las tablas son identicas y la clave primaria es MODELO, el not in no funciona alguie nsabe por que muchas gracias
Responder Con Cita
  #2  
Antiguo 09-04-2008
Avatar de poliburro
[poliburro] poliburro is offline
Miembro Premium
 
Registrado: ago 2004
Ubicación: México D.F
Posts: 3.068
Poder: 23
poliburro Va por buen camino
Código SQL [-]
 
INSERT 
   INTO MASTER 
          ( MODELO, MARCA, DESCRIPCION, Precio, [PRECIO PUBLICO], Type, 
           [Size], supplier, erate )
 
           SELECT MASTER1.MODELO, MASTER1.MARCA,     
                      MASTER1.DESCRIPCION, MASTER1.Precio, MASTER1.[PRECIO 
                      PUBLICO], MASTER1.Type, MASTER1.Size, 
                      MASTER1.supplier,  MASTER1.erate
              FROM MASTER1
            Inner Join MASTER 
                       On Master1.Modelo <> Master.Modelo
__________________
Conoce mi blog http://www.edgartec.com
Responder Con Cita
  #3  
Antiguo 09-04-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 18
richy08 Va por buen camino
Gracias Poliburro pero ya lo intente como lo pusiste y no funciona me duplical os registros
Responder Con Cita
  #4  
Antiguo 09-04-2008
Avatar de poliburro
[poliburro] poliburro is offline
Miembro Premium
 
Registrado: ago 2004
Ubicación: México D.F
Posts: 3.068
Poder: 23
poliburro Va por buen camino
Me podrías indicar que campo o campos forman tu llave primaria?
__________________
Conoce mi blog http://www.edgartec.com
Responder Con Cita
  #5  
Antiguo 09-04-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 18
richy08 Va por buen camino
Sip Claro MODELO es la llave primaria de las dos Tablas
Responder Con Cita
  #6  
Antiguo 10-04-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 18
richy08 Va por buen camino
Bueno aqui les dejo la solucion para que en u nfuturo a laguien le sirva

Código SQL [-]
 
INSERT INTO MASTER ( MODELO, MARCA, DESCRIPCION, Precio, [PRECIO PUBLICO], Type, [Size], supplier, erate )
SELECT MASTER1.MODELO, MASTER1.MARCA, MASTER1.DESCRIPCION, MASTER1.Precio, MASTER1.[PRECIO PUBLICO], MASTER1.Type, MASTER1.Size, MASTER1.supplier, MASTER1.erate
FROM MASTER1 LEFT JOIN MASTER ON MASTER1.[MODELO] = MASTER.[MODELO]
WHERE (((MASTER.MODELO) Is Null));

Se me esta hacend costumbre responderme solo jaja
Responder Con Cita
  #7  
Antiguo 10-04-2008
Avatar de richy08
richy08 richy08 is offline
Miembro
 
Registrado: may 2007
Ubicación: Bucerias, Nayarit Mexico
Posts: 529
Poder: 18
richy08 Va por buen camino
Bueno aqui les dejo la solucion para que en u nfuturo a laguien le sirva


Código SQL [-]

INSERT INTO MASTER ( MODELO, MARCA, DESCRIPCION, Precio, [PRECIO PUBLICO], Type, [Size], supplier, erate )
SELECT MASTER1.MODELO, MASTER1.MARCA, MASTER1.DESCRIPCION, MASTER1.Precio, MASTER1.[PRECIO PUBLICO], MASTER1.Type, MASTER1.Size, MASTER1.supplier, MASTER1.erate
FROM MASTER1 LEFT JOIN MASTER ON MASTER1.[MODELO] = MASTER.[MODELO]
WHERE (((MASTER.MODELO) Is Null));







Se me esta haciendo costumbre responderme solo jaja perdon creo que lo envie dos veces y n otiene boton de borrar
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

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Query dentro de otro query (Access) FGarcia SQL 2 28-12-2007 05:46:05
Query Access no funciona con ADO Delfino Conexión con bases de datos 6 15-06-2007 11:05:44
Como ejecutar un query de Access en Delphi tayra SQL 10 14-09-2004 09:34:21
Query by example (como en Access) Enano Conexión con bases de datos 3 17-05-2004 10:20:15
SQL UPDATE con Query en Access Rox77 Tablas planas 3 21-05-2003 15:49:06


La franja horaria es GMT +2. Ahora son las 10:18:02.


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