I have this query
SELECT Calendar."Production Week" FROM Opex
WHERE
(
Calendar."Production Week" BETWEEN VALUEOF("LAST_WEEK")-200
AND
VALUEOF("LAST_WEEK")
)
OR
(
(
(MOD(Calendar."Production Week", 100) = 1)
OR
(MOD(Calendar."Production Week", 100) = 13)
OR
(MOD(Calendar."Production Week", 100) = 26)
OR
(MOD(Calendar."Production Week", 100) = 39)
OR
(MOD(Calendar."Production Week", 100) = 52)
)
AND
(Calendar."Production Week" <=
VALUEOF("LAST_WEEK"))
)
ORDER BY Calendar."Production Week" DESC
then my question, is it any other way to make this query more shorter than it especially the MOD function because of it has the same result 200639, 200652, 200713, 2007 26, 200739…etc? Thanks in advance.
You could change the chain of OR to an IN clause