![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
17/01/2008, 09:26
|
![Avatar de the_scorpion](http://static.forosdelweb.com/customavatars/avatar137832_1.gif) | | | Fecha de Ingreso: mayo-2006 Ubicación: Cuba
Mensajes: 696
Antigüedad: 18 años, 9 meses Puntos: 3 | |
Re: como relacionar dos tablas en mysql puedes hacer tambien
select tabla1.campo1, tabla1.campo2, tabla2.campo1, tabla2.campo2 from tabla1 INNER JOIN tabla2 ON tabla1.camporelacion = tabla2.camporelacion where condicion order by tabla#.campo
o en su efecto
select * from tabla1 inner join tabla2 on tabla1.campo = tabla2.campo where tabla1.campo = de tabla1 consultar
También puedes relacionar tablas sin usar las clausulas JOIN:
select * from Clientes, Pedidos where tabla1.campo = tabla2.campo and tabla#.campo = < tabla# a consultar
__________________ Que hablen mal de uno es espantoso. Pero hay algo peor: que no hablen.
Quien hace, puede equivocarse. Quien nada hace, ya está equivocado". |