Join with id otherthan that with all ids

--------------- join with id otherthan that with all ids------



SELECT 
row_number() OVer (partition by salespersonid  order by  modifieddate ) as rn
salespersonid ModifiedDate,Name
INTo #temp From sales.Store




SELECT t1.*,t2.name as vs_name
FROM #temp t1 JOIN #temp t2
ON t1.salespersonid+1= t2.salespersonid



 

No comments: