Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is mean by 0 = 1 In Where statement in DB2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: What is mean by 0 = 1 In Where statement in DB2
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: 1187
Location: Bangalore,India

PostPosted: Thu Feb 22, 2007 4:04 pm    Post subject:
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    Post subject: Re: What is mean by 0 = 1 In Where statement in DB2
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us