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
 

 

Update table values with another table values using SQL

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

New User


Joined: 05 Apr 2005
Posts: 4

PostPosted: Tue Mar 07, 2006 5:13 pm    Post subject: Update table values with another table values using SQL
Reply with quote

Hi,

I need to update table values with another table values using SQL.
Help me please.
Back to top
View user's profile Send private message

ksmvali

New User


Joined: 05 Apr 2005
Posts: 4

PostPosted: Tue Mar 07, 2006 5:15 pm    Post subject:
Reply with quote

Hi,

I need to update 8265 rows with another table values using SQL.
Help me please.
Back to top
View user's profile Send private message
ragshere

New User


Joined: 20 Dec 2004
Posts: 70

PostPosted: Tue Mar 07, 2006 6:44 pm    Post subject: Re: update table
Reply with quote

Hi,
what type of help you are expecting?


Rags
Back to top
View user's profile Send private message
raghunathns

Active User


Joined: 08 Dec 2005
Posts: 127
Location: rochester

PostPosted: Tue Mar 07, 2006 7:16 pm    Post subject: Re: update table
Reply with quote

update table1

set col1 = (select colx from tbl2 where tbl1col = tbl2col)

where <your condition for 8256 rows>
Back to top
View user's profile Send private message
ragshere

New User


Joined: 20 Dec 2004
Posts: 70

PostPosted: Wed Mar 08, 2006 12:20 pm    Post subject: Re: update table
Reply with quote

Hi,

use this
update table1 T1

set col1 = (select colx from tbl2 T2 where T1.col = T2.col)

where <your condition for 8256 rows>


it will go fine.


Thanks
Rags
Back to top
View user's profile Send private message
ksmvali

New User


Joined: 05 Apr 2005
Posts: 4

PostPosted: Thu Mar 09, 2006 7:24 pm    Post subject:
Reply with quote

Thanks Rags
Back to top
View user's profile Send private message
Rameshs

New User


Joined: 15 Jun 2005
Posts: 53
Location: India, Chennai

PostPosted: Mon Mar 13, 2006 4:22 pm    Post subject: Updating all columns
Reply with quote

Update table1 t1 set row=(select * from table2 t2 where t1.col=t2.col)
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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am


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