Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Please ask technical questions in the appropriate category. Thank you!

Select don't work

Sandro CostaJan 7 2015 — edited Jan 15 2015

Hi.

I was testing a select before to create a view but it did not work. I need to select the name of three companies and restrict a city. I can select the 3 companies, but when I go restrict the city no error occurs, but the select returns me the same companies but in the entire state. If I select one company and a city, everything is fine,


My select is this.


select municipio, entidade from empresas

where entidade like '%EMPRESA01%' or entidade like '%EMPRESA02%' or entidade like 'EMPRESA03%' and municipio = 'Cidade01'

Thank you.

This post has been answered by KayK on Jan 7 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2015
Added on Jan 7 2015
5 comments
917 views