By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,334 Members | 1,328 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,334 IT Pros & Developers. It's quick & easy.

update statement

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<db********@yahoo.com> wrote in message
news:11**************************@posting.google.c om...
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

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
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.