im using mysql and was wondering about its syntax.
i want to make an IN clause something like this:
from_id OR to_id IN (
)
except i dont know how the syntax is
i want to avoid running the in clause twice like this:
from_id IN (
)
OR
to_id IN (
)
best of regards
alexander
If you have some reasons to worry about the IN clause being run twice (for example, if the subquery is particularly complex and the optimiser doesn’t seem to have taken advantage of caching the result set), you can always replace the IN clause with INNER JOIN.
So this:
becomes this: