Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 09:01 AM
db2group88@yahoo.com
Guest
 
Posts: n/a
Default update statement

i would like to use sql statement to update one column in the table
with the values from another table, is there anyway to do it? or use
db2 utility tool? we are using db2 udb v8.1 on windows , thanks
  #2  
Old November 12th, 2005, 09:01 AM
Mark A
Guest
 
Posts: n/a
Default Re: update statement

<db2group88@yahoo.com> wrote in message
news:111e249e.0407271249.605b7790@posting.google.c om...[color=blue]
> i would like to use sql statement to update one column in the table
> with the values from another table, is there anyway to do it? or use
> db2 utility tool? we are using db2 udb v8.1 on windows , thanks
>[/color]
Here is an example from the SQL Reference manual:

UPDATE EMPLOYEE EU
SET (EU.SALARY, EU.COMM)
=
(SELECT AVG(ES.SALARY), AVG(ES.COMM)
FROM EMPLOYEE ES
WHERE ES.WORKDEPT = EU.WORKDEPT)
WHERE EU.EMPNO = '000120'

You can download all the DB2 manuals in PDF format for free from the IBM
website:
http://www-306.ibm.com/cgi-bin/db2ww...bs.d2w/en_main


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,335 network members.