I'm having trouble performing a select on some tables, I did the following.
I have 5 tables (module, components, step, images, records)
the records table only receives ID's from other tables, it unifies the records actually,
What I need to do is fetch the records from the other tables based on the iD's that are in the record table. I have tried to do so but it is returning me repeated values.
SELECT modulo.nome_modulo,modulo.indice,modulo.revisao,componentes.codigo,componentes.local,etapa.etapa,componentes.quantidade,imagens.imagem FROM registros
INNER JOIN etapa ON etapa.id_etapa= registros.id_etapa
INNER JOIN componentes ON componentes.id_componente = registros.id_componente
INNER JOIN imagens ON imagens.id_componente = registros.id_imagem
INNER JOIN modulo ON modulo.id_modulo = registros.id_modulo
WHERE.....
I'm a beginner, I do not know if this is possible or not if this was the best way to do it.