joshua
joshua

Reputation: 31

How do you use an OR statement between two columns?

Trying to throw a OR statement that stretches over two columns, been trying sorts of variation but unable to get the correct syntax.

SELECT * FROM exampleTable    
WHERE firstColumn IN ('example1', 'example2')
OR secondColumn = 'example3'

I get an error on the second line saying " Incorrect syntax near ' (103010) (SQLExecDirectW)."

Upvotes: 0

Views: 122

Answers (1)

Ankit Agrawal
Ankit Agrawal

Reputation: 2454

SELECT * FROM exampleTable    
WHERE firstColumn IN ('example1', 'example2')
OR secondColumn in  ('example3')

Upvotes: 2

Related Questions