Appendix A. Predicate Rewrite Examples

This appendix lists some examples of predicates that could be rewritten to be more efficient, simpler, more readable, and more understandable. These predicates are stage 2 as of DB2 V8 and could possibly change in upcoming version releases. Sometimes you may not be sure how to rewrite predicates. These examples can give you a start.

Note

Remember that when coding the Between predicate, the values being checked are inclusive. With the Not Between predicate, the values are not inclusive. Also, when coding Between and Not Between predicates, it is logically important to list the lower value first.

Image

Predicate ...

Get DB2 SQL Tuning Tips for z/OS Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.