1
I have these two tables and would like to consult the owners according to the type of properties that has the id_proprietario.
what I tried to do was this:
select
*
from
proprietario
inner join
propriedade
on proprietario.id_agente = propriedade.proprietario
where propriedade.tipo = "Terreno" and exibicao = "Externo"
and proprietario.id_agente = "1"
With this I select all that fit in the filter, but do not know how to display the owners of this list without repeating, just once.
If the bank is wrong I can change too, if you can help me.
just put
distinct
:select distinct * from proprietario inner join propriedade on proprietario.id_agente = propriedade.proprietario where propriedade.tipo = "Terreno" and exibicao = "Externo" and proprietario.id_agente = "1"
– novic
As a merge condition do you really want to compare an int(11) (proprietary.id_agent) with a varchar(1000) (proprietary.proprietary property)? Search for foreign key.
– anonimo
error my proprietary.proprietary was to be an init also serving as foreign key
– Renan Teotonio
how does the distinct work? you know tell me I’ll search better to understand.
– Renan Teotonio