SELECT id, name, city
FROM people
WHERE title = 'Manager' OR city = 'Boston' OR HireDate > '1/25/04'
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Justin NPosted Feb 12, 2011, 12:39 PM
Assuming a large table with indexed search fields, rewrite the given query to not use OR statements in the WHERE clause. Try to make it as efficient as possible.
SELECT id, name, city
FROM people
WHERE title = 'Manager' OR city = 'Boston' OR HireDate > '1/25/04'
SELECT id, name, city
FROM people
WHERE title = 'Manager' OR HireDate > '1/25/04'
this is the exact question
Suthish NairPosted Feb 12, 2011, 1:29 AM