IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is mean by 0 = 1 In Where statement in DB2


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
callkris_cit

New User


Joined: 22 Apr 2006
Posts: 44

PostPosted: Thu Feb 22, 2007 4:01 pm
Reply with quote

Hi All,

Select * from tablename where 0 = 1. What does it mean?

Regards
Suresh
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Feb 22, 2007 4:04 pm
Reply with quote

Hi Suresh,

It would not fetch any row since 0 never be equal to 1
Back to top
View user's profile Send private message
silan

New User


Joined: 16 Jun 2006
Posts: 8
Location: new delhi

PostPosted: Thu Feb 22, 2007 4:43 pm
Reply with quote

Hi,

This is a very common technique used for tuning.

0 = 1 predicate is used to influence the access path .

Ex:SELECT CORP_CODE,SALES_OFFICE
FROM TABLE1
WHERE CORP_CODE IN ('10' , '20') OR '0=1';;;;

u can get more on this from Mullins book.

-cheers.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts Relate COBOL statements to EGL statement All Other Mainframe Topics 0
No new posts process statement for SUPREC, CMPCOLM... TSO/ISPF 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
No new posts DFDSS COPY using Filter REFDT statement JCL & VSAM 2
Search our Forums:

Back to Top