We have a BI tool that generates and runs its own sql. We the programmers/system admins hate it as it can write some really goofy looking statements. Just wondering if there would ever be a reason to run statement A vs B. A was generated by the software and I just updated it to look a little more normal. Seems to me the sub query in the from clause could have quite a few ramifications.
Statement A
Statement B
Statement A
Code:
SELECT * FROM (SELECT * FROM SWANWHSE30.SNORDRSM WHERE OSCOMP = 1 AND OSDICD IN (1,9) AND OSDZDT >=1170425) T0 WHERE ((T0.OSDZDT >= 1170425) AND (T0.OSDZDT <= 1170425))
Code:
SELECT * FROM SWANWHSE30.SNORDRSM t0 WHERE OSCOMP = 1 AND OSDICD IN (1,9) and T0.OSDZDT between 1170425 AND 1170425
Comment