1
Hello. I am using oracle 11 g.
I’m trying to search a state table for a particular city.
For example, the state of Bahia has several cities. If Salvador is informed, he must return to the state of Bahia. The query I am 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';
Gives error that the command has been closed improperly.
If I do:
select * from estado as e join cidade as c on e.id_estado=c.fk_id_cidade;
It works, but it brings several cities. If I passed a city id, I would find it, but the search parameter is by the name of the city.
@Bacco also does not work. I tried to use group by state, but also me does not work.
– André Nascimento