The following is a Where statement of a long query
WHERE XA.INIT_APP = 'GEIA-0007'
AND XB.LCNTYPXB = 'p'
AND ERNLOC.UOCSEIXC ='AZ1'
OR ERNLOC.UOCSEIXC ='AZ0'
OR ERNLOC.UOCSEIXC ='AY0'
OR ERNLOC.UOCSEIXC ='AU0';
The first 2 rows work fine, the problem is the next 4 rows, the query provides data for only 3 rows AZ1, AZ0 and AY0 and gives nothing for AU0. I tried to change the order but the problem persists. My question is there any limitation with AND and OR where you have to use parentheses any help would be very appreciated.
WHERE XA.INIT_APP = 'GEIA-0007'
AND XB.LCNTYPXB = 'p'
AND
(
ERNLOC.UOCSEIXC ='AZ1'
OR ERNLOC.UOCSEIXC ='AZ0'
OR ERNLOC.UOCSEIXC ='AY0'
OR ERNLOC.UOCSEIXC ='AU0'
);
What is funny no matter witch one I used it is always the first 'AZ1' that is missing. I change the first one with 'AZ0' and now is 'AZ0' that are missing.
Event try this
WHERE (((XB.LCNTYPXB) = 'p')
AND ((ERNLOC.UOCSEIXC) ='AZ1'))
OR (((ERNLOC.UOCSEIXC) ='AZ0'))
OR (((ERNLOC.UOCSEIXC) ='AY0'))
OR (((ERNLOC.UOCSEIXC) ='AU0'));