Friday, November 30, 2018

On Par With Window Functions

Use a golf analogy when explaining to executives. Use a car analogy for all others. — Confucius

The purpose of window functions is to translate the business reporting requirements declaratively and effectively to SQL so query performance and developer/business-analyst efficiency improve dramatically. I’ve seen real-world reports and dashboards go from hours to minutes, minutes to seconds after using window functions. Query size decreases from 40-pages to a few pages. Back in the ‘90s, Redbrick database really understood the business use case and created a new layer of functionality to do business reporting that included ranking, running totals, calculating commissions & inventory based on subgroups, positions, etc. These have been in SQL standard in 2003. Every BI layer (like Tableau, Looker, Cognos) exploits this functionality.

Introduction to Window Functions

Imagine you have scores of six golfers through two rounds. Now, you need to create the leaderboard and rank them. Rank them using SQL.



from DZone.com Feed https://ift.tt/2ABrXGQ

No comments:

Post a Comment