469,282 Members | 1,704 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

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
Nov 12 '05 #1
1 6534
<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.

Similar topics

3 posts views Thread by Mark A Framness | last post: by
7 posts views Thread by Dave | last post: by
8 posts views Thread by Lauren Quantrell | last post: by
2 posts views Thread by Mike Leahy | last post: by
1 post views Thread by amitbadgi | last post: by
3 posts views Thread by Michel Esber | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.