1

A normal IN clause is written like this:

SELECT * 
FROM x
WHERE
x.field IN (100, 200, 300, 400)

However, this is only one field. I need to write a query where I do look ups over 2 fields.

That is: Pseudo Code -->

SELECT * 
FROM x
WHERE
IN (x.field1 = 100 AND x.field2 = 'someString', x.field1 = 200 AND x.field2 = 'someOtherString')

What is a convenient way to write such query?

1 Answer 1

2

Please take a look at this example: http://sqlfiddle.com/#!15/57223/1

select * from q
where 
  (x,y) in ((1,2),(5,5))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.