MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help on Discard

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
Veera333
Beginner


Joined: 16 Jul 2010
Posts: 7
Topics: 5

PostPosted: Wed Aug 11, 2010 1:53 am    Post subject: Help on Discard Reply with quote

Hi,

Can i use joins in DISCARD statement.

For example DISCARD FROM TABLE A
WHEN (SELECT 1 FROM TABLE B
WHERE A.COLUMN1 = B.COLUMN1)

Thanks in advance.


Thanks,
Veera
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Aug 11, 2010 9:29 am    Post subject: Reply with quote

Veera333,

If your intention is to delete the matching rows from table A then use the following sql (untested)


Code:

DELETE                                         
  FROM TABLEA X                             
 WHERE COLUMN1 IN (SELECT COLUMN1               
                     FROM TABLEB Y           
                    WHERE X.COLUMN1 = Y.COLUMN1)
  ;                                   


Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group