471,896 Members | 1,219 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,896 software developers and data experts.

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 6558
<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 YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.