-2
I want to access data from two different tables: ocorrencia
and fotos
.
- On the table
fotos
I have a field that is theid_ocorrencia
(which creates the relation - foreign key). - On the table
ocorrencia
no foreign table keyfotos
.
When I perform this query:
select
nome_foto
from
ocorrencia
inner join fotos
on fotos.id_ocorrencia=ocorrencia.id_ocorrencia
works, but when I run this:
select
Id_ocorrencia, nome_foto
from
ocorrencia
inner join fotos
on fotos.id_ocorrencia=ocorrencia.id_ocorrencia
go wrong
how would Andrey look?
– Menino Hori