How to Reduce Syntactic Overhead Using the SQL WINDOW Clause

SQL is a verbose language, and one of the most verbose features are window functions. In a stack overflow question that I've encountered recently, someone asked to calculate the difference between the first and the last value in a time series for any given day: Input volume tstamp --------------------------- 29011 2012-12-28 09:00:00 28701 2012-12-28 10:00:00 … Continue reading How to Reduce Syntactic Overhead Using the SQL WINDOW Clause

SAP’s Hilarious SQL Whitepaper(s)

While looking for some authoritative information about Sybase SQL Anywhere 12's TOP .. START AT clause, I stumbled upon this hilarious white paper here, which I do not want to keep from you: http://www.sybase.com/files/White_Papers/Sybase_Top_10_Features_In_SQL_Anywhere_12.pdf I will take advantage of "fair use policy" and cite parts from section 7: Feature number 7: improved support for DaffySQL … Continue reading SAP’s Hilarious SQL Whitepaper(s)

GROUP BY ROLLUP / CUBE

Every now and then, you come across a requirement that will bring you to your SQL limits. Many of us probably give up early and calculate stuff in Java / [or your language]. Instead, it might've been so easy and fast to do with SQL. If you're working with an advanced database, such as DB2, … Continue reading GROUP BY ROLLUP / CUBE