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 where exists and not exists will do in SELECTstatement?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
shivakumar .b
Warnings : 1

New User


Joined: 11 May 2005
Posts: 18
Location: bangalore

PostPosted: Wed May 11, 2005 5:11 pm    Post subject: what where exists and not exists will do in SELECTstatement?
Reply with quote

hi everybody,
This is shivakumar.
I want to know what the WHERE EXISTS AND WHERE NOT EXISTS will do in SELECT statement, that is i want to know for what purpose we are using this exists clause.
i am waiting for reply.
thanks in advance.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed May 11, 2005 5:16 pm    Post subject: Re: what where exists and not exists will do in SELECTstatem
Reply with quote

Check the link...

Quote:
http://www.ibmmainframes.com/viewtopic.php?t=387&highlight=exists


Regards,
Priyesh.
Back to top
View user's profile Send private message
ajay_dheepak

New User


Joined: 12 May 2005
Posts: 32
Location: Chennai

PostPosted: Thu May 19, 2005 5:31 pm    Post subject:
Reply with quote

consider the following query

SELECT EMPNO,LASTNAME
FROM TABLE1
WHERE EXISTS
(SELECT *
FROM TABLE2 WHERE BDATE < '1986-01-01');

The above query returns all the EMPNO and LASTNAME if there is any BDATE in TABLE2 which is less than '1986-01-01'.
Back to top
View user's profile Send private message
shivakumar .b
Warnings : 1

New User


Joined: 11 May 2005
Posts: 18
Location: bangalore

PostPosted: Fri May 20, 2005 10:55 am    Post subject: Re: what where exists and not exists will do in SELECTstatem
Reply with quote

HELLO AJAY_DHEEPAK, THANK U VERY MUCH FOR U R REPLY.
YOU HAVE MENTIONED A VERY GOOD EXAMPLE. THANKS A LOT.
BYE
REGARDS,
B.SHIVAKUMAR
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 HOW TO INCREASETHE GDG LIMIT ,WHICH E... cmsmoon JCL & VSAM 7 Wed Dec 04, 2013 4:25 pm
No new posts DUPLICATE NAME EXISTS IN CATALOG problem don.leahy JCL & VSAM 13 Tue Jun 28, 2011 7:23 pm
No new posts To find whether a TAPE file exists, u... jinujhn JCL & VSAM 1 Sat Apr 09, 2011 12:42 pm
No new posts SQL to check, if an Employee# exists ... VivekKhanna DB2 5 Wed Aug 04, 2010 12:26 am
No new posts Gettign TBSCAN return code as 8, but ... sushanth bobby TSO/ISPF 7 Fri Jul 02, 2010 11:22 pm

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