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
 
Help on SQL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Help on SQL
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:


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