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: 9 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: 9 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.
Many organizations today cannot use public cloud solutions because of security concerns, administrative challenges and functional limitations. However, they still need a centralized platform where end users can conduct self-service analytics in an IT-enabled environment....More
It is crucial to move away from data and analytics stored on individual desktop computers. Today’s solutions must promote holistic, collective intelligence. The strong, continued alliance between Microsoft and Pyramid Analytics helps make all this possible....More
To become a truly data-driven enterprise, many business leaders recognize that they must extend the capabilities of self-service business intelligence (BI) and analytics to more of their business users. Many BI tools tackle part of this need, but they don’t offer a complete enterprise solution....More