select data from table where (field = value or field2 = value2) and not(field = value and field2 = value2)
should work
SOL
I'm only guessing but my guess work generally works for me.
Supposedly Oracle is smart enough to not execute every query twice (optimization...).
My experience is that unions and minus work generally better than or's, but you can try both approaches anyway.
And having an index over the field/s you select (at least the first one in order) should help you. Union and intersect algorithms order your data before executing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.