0
Here’s the thing, I want to select in the model table that shows, in addition to the fields shown in SELECT
, the field lamina_tubo_primaria.DESC_PRIMARIA
also.
But the countryside DESC_PRIMARIA
only relates to the model table by means of the table lamina_tubo_secundaria
.
SELECT m.id_modelo, m.descricao, f.nome fabricante, o.nome optico FROM modelo m LEFT JOIN fabricante f ON f.id_fabricante = m.id_fabricante LEFT JOIN optico o ON o.id_optico = m.id_optico;
... FROM modelo m INNER JOIN lamina_tubo_secundaria s ON (m.id_lamina_tubo_secundaria = s.id_lamina_tubo_secundaria) INNER JOIN lamina_tubo_primaria p ON (s.id_lamina_tubo_primaria = p.id_lamina_tubo_primaria)
. Since you didn’t post the other tables involved I assume you know how to do.– anonimo
Thank you, that’s right
– MatSIN