Hello. I'm using oracle 11g.
I'm trying to search a status table for a certain city.
For example, the state of Bahia has several cities. If you are informed of Salvador, you should return Bahia state. The query I'm trying to do is:
select * from estado as e join cidade as c on e.id_estado=c.fk_id_cidade on c.cidade='Salvador';
It gives the error that the command was terminated improperly.
If I do:
select * from estado as e join cidade as c on e.id_estado=c.fk_id_cidade;
It works, but there are several cities. If I passed the id of a city, I would find it, but the search parameter is by the name of the city.