SELECT LASTNAME, FIRSTNAME, ADDR1 FROM EMP SELECT LASTNAME, FIRSTNAME, ADDR1 FROM EMP WHERE 1 = 1Is there any difference in the treatment of the optimizer for the above two queries?
I've never seen an approach like this before. Perhaps you are confusing this with the approach of appending OR...
0 = 1 to a predicate to force DB2's hand when selecting an index at bind time. For example, consider this statement:
SELECT a,b,c FROM table1 WHERE d between 'A' and 'F' AND e > 1500;
SELECT a,b,c FROM table1 WHERE d between 'A' and 'F' AND (e > 1500 OR 0 = 1);
Dig Deeper on IBM DB2 management
Related Q&A from Craig S. Mullins
Our expert suggests that the best way to pass the SAP BW exam is to have hands-on job experience. But that's not all he has to say about ... Continue Reading
To export data from a DB2 table to a flat file, you need to run an export specifying the proper file format. The export utility exports data from a ... Continue Reading
Craig Mullins recommends two specific resources for learning how to create and support Binary Large Objects (BLOB) in DB2. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.