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
 
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 Insert a Row_number into table useit DB2 2 Tue Sep 19, 2017 1:07 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts PC (UTF-8) -> z/OS (EBCDIC) -> ... prino All Other Mainframe Topics 4 Fri Sep 01, 2017 1:47 am

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