Home Forums Article Discussions Article Discussions by Author Discuss content posted by Divya Agrawal Compare Dates in an iterative manner for a particular set of records RE: Compare Dates in an iterative manner for a particular set of records
James Goodwin
Hall of Fame
Points: 3691
More actions
November 12, 2008 at 6:49 am
#897476
Why use the cross join?
SELECT *
FROM PersonRecord A
INNER JOIN PersonRecord B
ON A.PersonID = B.PersonID
AND A.VersionID = B.VersionID - 1
WHERE B.DEDate > A.DEDate