user2093576
user2093576

Reputation: 3092

Oracle Query with AND and OR

How can I write the following scenario as query in Oracle

SELECT *
FROM table1
WHERE col1 = 'SOMENAME' WITH (EITHER COL2 = 'Y' OR COL3 = 'Y')

Upvotes: 0

Views: 50

Answers (1)

Lukasz Szozda
Lukasz Szozda

Reputation: 175706

You need to use AND:

Select * 
from table1 
where col1 = 'SOMENAME'
 AND (COL2 = 'Y' OR COL3 = 'Y')

Upvotes: 4

Related Questions