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 |
|
krishmallela
Starting Member
2 Posts |
Posted - 2011-11-29 : 00:09:23
|
| Hi All,I have two tem tables like below Table name1 - #TempOldID ChangesetID34 1335 13Table name2 - #TempNewID ChangesetID53 2254 22Now i want to display the data like below oldID NewID34 5335 54Could you please help me how can i do this? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-11-29 : 00:12:16
|
what is the relationship between these 2 tables ? How do you relate ID 34 to 53 ? based on ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-29 : 03:40:19
|
bsed on your output, it looks like this, but it makes no sense at all!SELECT t1.ID,t2.IDFROM (SELECT ROW_NUMBER() OVER (ORDER BY ID) AS Rn,* FROM #TempOld)t1JOIN (SELECT ROW_NUMBER() OVER (ORDER BY ID) AS Rn,* FROM #TempNew)t2ON t2.Rn=t1.Rn ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|