SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 SQL Server 2008 How two to get tables records in s
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Srinishak1
Starting Member

India
3 Posts

Posted - 03/02/2014 :  10:12:38  Show Profile  Reply with Quote
SQL Server 2008 How two to get tables records in same database and get column is changed. But changed column values should come from Table B. Not required Table A value to similar records.

TABLE A

year week Product Qty Price

2013 1 A 20 150
2013 1 B 50 200
2013 2 A 90 100
2013 3 D 90 100
2013 1 C 100 205
2013 2 B 200 555
2013 3 C 300 333


TABLE B

year week Product Qty Price

2013 1 B 50 200
2013 2 A 90 111
2013 3 D 90 100
2013 1 C 100 350
2013 2 B 200 555
2013 3 C 300 444
2013 2 D 666 888


But I need the result set like below

2013 2 A 20 777
2013 1 A 20 150
2013 1 B 50 200
2013 2 A 90 111
2013 3 D 90 100
2013 1 C 100 350
2013 2 B 200 555
2013 3 C 300 444
2013 2 D 666 888

kindly help for this issue..




Rajan

visakh16
Very Important crosS Applying yaK Herder

India
52309 Posts

Posted - 03/02/2014 :  11:25:22  Show Profile  Reply with Quote
Your output is not clear. Can you explain how you got the first row?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000