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.
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
Data quality is really important. Why? Because it helps you save money while increasing profits because of accurate contact data. It’s important to understand what data quality is and why it is important....More