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

Help on SQL


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
deepu.surya
Warnings : 1

New User


Joined: 01 Apr 2008
Posts: 10
Location: hyderabad

PostPosted: Wed Aug 12, 2009 6:09 pm
Reply with quote

Hi all,

I need to delete two differnet records in a table. The unique index combination is two columns (lets say colA, colB). Is there any way where i can include these two conditions in single SQl..

SQL 1:

delete from table
where colA = A and
where colB = B

SQL 2:

delete from table
where colA = C and
where colB = D

Can i combine SQL 1 and SQL2 assuming there wil be some records with cross references like (colA = A and colB = D will give me a record)
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Aug 12, 2009 6:15 pm
Reply with quote

Code:
delete from table
where (colA = A and colB = B)
or (colA = C and colB = D)
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

 


Search our Forums:

Back to Top