422,764 Members | 1,289 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,764 IT Pros & Developers. It's quick & easy.

How to copy one column into another in DB2 sql

P: 1
How to copy one column into another column using SQL

SELECT DISTINCT T1.PROJECT_NAME,
T1.REFERENCE_ID,
T1.NAME AS URL1_title,
T1.URL AS URL1,
T1.REQUEST_TYPE,
T2.VAL,
T3.VAL AS VAL1
FROM RIDW.VW_REQUEST T1
LEFT OUTER JOIN RICALM.VW_RQST_STRING_EXT T2
ON T2.REQUEST_ID=T1.REQUEST_ID AND T2.NAME='owner_1'
LEFT OUTER JOIN RICALM.VW_RQST_STRING_EXT T3
ON T3.REQUEST_ID=T1.REQUEST_ID AND T3.NAME='owner_2'
WHERE T1.PROJECT_ID = 0 AND
( T1.REQUEST_TYPE = 'Task'
) AND
(T1.ISSOFTDELETED = 0) AND
(T1.REQUEST_ID <> -1 AND T1.REQUEST_ID IS NOT NULL)

Here is my sql query I want to copy owner_2 col into owner_1 col

there are two column here owner_1 and owner_2, I want to copy all contents from owner_2 to owner_1

owner1 owner2

| ABC| |ABC|

|PQR | |LMN|

output- totalowner

|ABC|

|PQR|

|ABC|

|LMN|

how can I do it using DB2 query?
Oct 6 '17 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.