Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2007-05-01 : 01:51:47
|
UPDATE tbl_emp_contactSET email = ?,phone =?WHERE loan_number='021067367' Iam trying to update the union value from below to the update statement.There will be only one value after the union.Either a value or a NULL value.SELECT email_addr,phone_numberFROM staging.dbo.tbl_emp WHERE loan_number='021067367' UNIONSELECT email_addr,phone_numberFROM archive_reporting.dbo.tbl_empWHERE loan_number='021067367' |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-01 : 02:09:05
|
[code]update uset email = a.email_addr, phone = a.phone_numberfrom tbl_emp_contact uinner join ( SELECT loan_number, email_addr,phone_number FROM staging.dbo.tbl_emp UNION SELECT loan_number, email_addr,phone_number FROM archive_reporting.dbo.tbl_emp ) a ON u.loan_number = a.loan_numberWHERE u.loan_number = '021067367'[/code] KH |
 |
|
sqllearner
Aged Yak Warrior
639 Posts |
Posted - 2007-05-01 : 02:22:40
|
Thanks a lot |
 |
|
|
|
|