SQL - How to undo ambiguous outer join?

1

I'm trying to normalize a database to addresses and zip codes. However, there is a situation in which the Post Office allocates, for the same public place, a ZIP code for the side with even numbers and another for the side with odd numbers, and another where the places are divided and, for each division, a zip code for the side with odd numbers and the other side with odd numbers. As there is side in both cases, I created a single table, registering "even side" and "odd side". The problem (ambiguous external join) appeared when I tried to connect the two types of sites to this single Side table, because the bank probably does not know which instruction to perform first, since both require the information in the Side table. Below the illustrative figure:

So,isthereawaytoeliminatethis"ambiguous outer join" error without having to repeat the Side table?

Thanks.

    
asked by anonymous 04.07.2018 / 22:14

1 answer

2

The ambiguity may be because in the SQL query you are only using idLado instead of NomeDaTabela.idLado . For example, instead of ...

select (...) where idLado = 1

... you should do ...

select (...) where LogradouroLado.idLado = 1

... or call the table for example from LogradouroLado as t1 and make t1.idLado . Got the idea?

This as is optional.

    
05.07.2018 / 01:42