Visual Basic - ¡¡URGENTE!! CONSULTA DE DOS TABLAS

Life is soft - evento anual de software empresarial
 
Vista:

¡¡URGENTE!! CONSULTA DE DOS TABLAS

Publicado por erikur raudi (2 intervenciones) el 26/11/2007 20:15:43
HOLA A TODOS.

NECESITO HACER UNA CONSULTA QUE ME TRAIGA TODOS LOS REGISTROS QUE ESTEN EN LA TABLA a Y EN LA TABLA b

REALIZO UNA CONSULTA QUE NO ARROJA NADA O ARROJA UNA CANTIDAD 4 VECES MAYOR DE REGISTROS DE LOS QUE TENGO EN MI BASE DE DATOS.

ESTA ES LA CONSULTA QUE REALIZO:

SELECT * FROM TABLA1,TABLA2 where TABLA1.campo1=TABLA2.campo1 and TABLA1.campo2=TABLA2.campo2 and … and TABLA1.campoN=TABLA2.campoN

QUE ESLO QUE ESTA MAL?

SI ALGUIEN PUDIERA DECIRME COMO HAGO ESTA CONSULTA PARA QUE BUSQUE EN AMBAS TABLAS LOS REGISTROS DE LA TABLA1 QUE ESTAN DENTRO DE LA TABLA2.

ESPERO SUS COMENTARIOS.

GRACIAS
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:¡¡URGENTE!! CONSULTA DE DOS TABLAS

Publicado por conti (1 intervención) el 26/11/2007 23:10:23
NECESITO HACER UNA CONSULTA QUE ME TRAIGA TODOS LOS REGISTROS QUE ESTEN EN LA TABLA a Y EN LA TABLA b

SI ALGUIEN PUDIERA DECIRME COMO HAGO ESTA CONSULTA PARA QUE BUSQUE EN AMBAS TABLAS LOS REGISTROS DE LA TABLA1 QUE ESTAN DENTRO DE LA TABLA2

¿EN QUE QUEDAMOS, ACASO SABES LO QUE ESTAS PREGUNTANDO?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:¡¡URGENTE!! CONSULTA DE DOS TABLAS

Publicado por fede (189 intervenciones) el 27/11/2007 16:39:05
haber kerido primero kiero saber si tenes alguna relacion osea lo ideal es en tabla a idmov relacionarlo con tabla b idmov entonces el realizar la consulta es mas facil y haces asi.
SELECT distinct * FROM TABLA1,TABLA2 where TABLA1.idmov=TABLA2.idmov order by id mov
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:¡¡URGENTE!! CONSULTA DE DOS TABLAS

Publicado por horacio  (12 intervenciones) el 28/11/2007 13:38:37
si no te mandaron nada proba con esto

select * from tabla1 inner join tabla2 on tabla1.campo1= tabla2.campo2 and ..
tabla1.campon.=tabla2.campon
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar