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

Updating table 1 column with table 2 column


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Thu Jul 13, 2006 11:11 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top