|
Archives of the TeradataForumMessage Posted: Fri, 19 Apr 2002 @ 12:37:10 GMT
Another mystery???? Query #1: SELECT B1.AQBICLS, B1.AFVCPRO, ASEIXXX FROM CPCLMA.QCLMA001 A1, ( SELECT AQBICLS,AFVCPRO FROM CPCLMB.QCLMB001 WHERE ASEIXXX IN ('02024640948','01620099028') AND AFVCPRO IN ('87620','87621','87622') or 0 = 1 ==> added this to force not using index on AFVCPRO ) B1 WHERE A1.AQBICLS=B1.AQBICLS Results of Query #1: Good results AQBICLS AFVCPRO ASEIXXX 719766317 87622 01620099028 778417390 87622 02024640948 Query #2: removed the "or 0=1" SELECT B1.AQBICLS, B1.AFVCPRO, ASEIXXX FROM CPCLMA.QCLMA001 A1, ( SELECT AQBICLS,AFVCPRO FROM CPCLMB.QCLMB001 WHERE ASEIXXX IN ('02024640948','01620099028') AND AFVCPRO IN ('87620','87621','87622') ==> now using index on AFVCPRO ) B1 WHERE A1.AQBICLS=B1.AQBICLS Results of Query #2: Bad results AQBICLS AFVCPRO ASEIXXX 719766317 99214 01620099028 778417390 S0612 02024640948 Thought maybe index was created wrong, so DROPPed and rebuilt, but still get same results?? Thanks, Tony.
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||