newtelligence poweredRSS 2.0
# Friday, January 23, 2009

Earlier this week, I had a request to write a query, which required comparing one row to the row that followed. While I had something like this before using sub queries with MIN/MAX, I just didn’t have the time to hack thru it. Today, I got an e-mail from SQL Server Central (.com) from their mailing list, and one of the featured articles was “Linking to the previous row”. This sounded like what I needed for my query, so I decided to check it out.

The opening of the article describes my situation exactly, and by using the method described, I was able to write my query in a couple of minutes using CTE’s and the Rownumber function. I highly recommend the article.

Friday, January 23, 2009 10:33:59 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Sql
Comments are closed.
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Copyright 2010
Adam Salvo
Sign In
Statistics
Total Posts: 251
This Year: 26
This Month: 0
This Week: 2
Comments: 34
Themes
Pick a theme:
All Content 2010, Adam Salvo
DasBlog theme 'Business' created by Christoph De Baene (delarou)