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 |
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2013-03-20 : 03:36:32
|
Hi All,I have 2 Table; 1 is old & 1 is new:OldID cos vendor1 100 ABV2 200 AGVNewID cos vendor1 200 YBV3 900 LGVOutput i want is:ID cos vendor Old New Old New1 100 200 ABV YBV2 200 - AGV -3 - 900 - LGV Please advise.Thank you.Regards,Micheale |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-03-20 : 03:38:20
|
[code]SELECT COALESCE(o.ID, n.ID) ID, o.cost OldCost ,n.cost NewCost, o.vendor OldVendor, n.vendor OldVendorFROM Old oFULL OUTER JOIN new n ON o.Id= n.ID[/code]--Chandu |
|
|
|
|
|