Hopefully MS will implement Standard SQL's LAG/LEAD/FIRST_VALUE/LAST_VALUE including the option in a future release. Then it's a simple "LAG(col1 IGNORE NULLS) OVER (ORDER BY id)"
T-SQL Challenge - CombinationsCommented on: 8 years ago
(January 28, 2008)
I like that puzzle, you just have to know how recursive queries work :-)
WITH cte (vid, amt)
SELECT vid, amt
SELECT v.vid, cte.amt + v.amt
FROM vouchers AS v...
Mode PuzzleCommented on: 8 years ago
(October 4, 2007)
Nested aggregates, before SS2005 this was quite awfull, but now there's WITH or (my favourite) OLAP functions: Easy to write and easy to extend
Digital Magazine Archives
Browse back issues of SQL Server Pro, from January 2007 through the last issue published in April 2014. Find the back issues here.
Are you dealing with national and international records? The more expansive your records are in territory, the more problems you will face when it comes to verifying addresses. Not only are you dealing with language differences, but you are also dealing with different address formatting for different countries....More
Your contact data is valuable, but is it up to its full potential? Without the proper maintenance, the quality of your data quickly decreases--so quickly that 50% of databases deteriorate after only two years. It is an absolute necessity to maintain your data in order to decrease costs and increase profits....More