﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / T-SQL (SS2K5)  / Compare rows in tables / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 19 May 2013 02:06:59 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Compare rows in tables</title><link>http://www.sqlservercentral.com/Forums/Topic815847-338-1.aspx</link><description>Hi, if you have the row number for the table already you could join this table in on itself as below allow you to join one row to the next[code="sql"]SELECT	table1.column1,             table2.column2FROM Sampletable as table 1	LEFT OUTER JOIN Sampletable as table2	ON table1.rownumber+1 = table2.rownumber[/code]</description><pubDate>Mon, 09 Nov 2009 09:34:11 GMT</pubDate><dc:creator>Nick_UK</dc:creator></item><item><title>Compare rows in tables</title><link>http://www.sqlservercentral.com/Forums/Topic815847-338-1.aspx</link><description>Hi,I need to compare concecutive records in a single table and find the difference of 1 column .Iam grouping with rownumber ,but how do I compare the row 2 with row 1row3 with row2 and get the difference.Thanks for your help.Demin</description><pubDate>Mon, 09 Nov 2009 08:56:34 GMT</pubDate><dc:creator>demin99</dc:creator></item></channel></rss>