Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Updating table 1 column with table 2 column

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
seluri

New User


Joined: 13 Jul 2006
Posts: 2

PostPosted: Thu Jul 13, 2006 5:08 am    Post subject: Updating table 1 column with table 2 column
Reply with quote

Hi
I am looking for DB2 SQL UPDATE EXAMPLE QUERY FOR UPDATE TABLE "A " column with table "B" column. I want to run this in QMF.
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Jul 13, 2006 11:11 am    Post subject:
Reply with quote

Hi ,

You can use following query

UPDATE A
SET a = ( SELECT b
FROM B
WHERE .........')
WHERE .............;

By this query you can update coloumn a of Table A by Cloumn b of Table B.
Back to top
View user's profile Send private message
Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Thu Jul 13, 2006 11:31 am    Post subject: Hi
Reply with quote

Try this..

UPDATE TEST.TABLE1
SET FIRST_COL_DATE=SEC_COL_DATE


-Han
Back to top
View user's profile Send private message
seluri

New User


Joined: 13 Jul 2006
Posts: 2

PostPosted: Sat Jul 15, 2006 12:49 am    Post subject:
Reply with quote

thanks
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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Join of more than one table dibyendumandal11111 DB2 6 Mon Feb 13, 2017 11:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us