INNER JOIN com quatro tabelas

MySQL

PHP

10/05/2016

Olá tudo bem, eu estou com problema em unir quatro tabelas, fiz INNER JOIN com duas tabelas e foi tranquilo, mas para unir quatro não tenho ideia rsrs. Preciso unir as tabelas usuario, material, lote, e testes.

"SELECT * FROM material INNER JOIN usuario INNER JOIN lote INNER JOIN testes ON lote.material_idMaterial=idMaterial AND material.Usuario_idLogin=usuario.idLogin ON lote.idLote=testes.Lote_idLote ORDER BY idMaterial ASC";
Eduardo Kmiecik

Eduardo Kmiecik

Curtidas 1

Melhor post

Fabiano Carvalho

Fabiano Carvalho

11/05/2016

Sempre que for postar códigos utilize a tag CODE.
Abaixo como voce pode resolver seu problema.


SELECT * FROM TABELA1
INNER JOIN TABELA2 
ON TABELA1.ID = TABELA2.ID
INNER JOIN TABELA3
ON TABELA2.ID = TABELA3.ID
INNER JOIN TABELA4
ON TABELA3.ID = TABELA4.ID
GOSTEI 1

Mais Respostas

Eduardo Kmiecik

Eduardo Kmiecik

10/05/2016

Eu me cadatrei ontem no DevMedia rsrs não conheço muito bem ainda. E obrigado pela resposta, me ajudou bastante
GOSTEI 1
POSTAR