Mysql
 SQL >> Base de Dados >  >> RDS >> Mysql

MySQL — consultar três tabelas

Join no MySQL

Tente isto:

select * from table1 t1 join table2 t2 on t1.t2ref = t2.id join table3 t3 on t2.t3ref = t3.id 

Adicione uma cláusula where para pesquisar determinadas linhas em table1:

where t1.field = 'value'