There was SQL before window functions and SQL after window functions: that’s how powerful this tool is. Being that of a deal breaker unfortunately means that it can be quite hard to grasp the feature. This article aims at making it crystal clear so that you can begin using it today and are able to reason about it and recognize cases where you want to be using window functions.
Suppose you have a storefront application that sells pictures of cats. These cat pictures are categorized in meaningful ways. For example, there are LOLcats pictures and “Classic” cat pictures. Now, on the landing page of the store, you’d like to feature one picture from each category. It can’t be a random picture from each. You need to feature the cheapest picture from each category, displaying its name and price.
Also, it turns out that some “low” prices are very common. For example, $9.99 is a common sale price for LOLcats pictures. However, we should only ever feature one picture per category. When there are multiple pictures with the same low price, we fallback to the name, and show the first one alphabetically. How can we solve this problem, while also remaining performant?
current home project does a lot of processing and since I paid money for a 4 core processor I would like to do as much of that in parallel as possible. I have been using Intel’s Threading Building Blocks (TBB) for a while now and although some of what TBB does has been taken over by the thread library in C++11 there are still some useful features in TBB.
Concurrent programming is hard to begin with, the fact that we need to rethink our APIs just makes it harder.
Come join the party!
Gesunde Ernährung ist eines der wichtigsten Themen unserer Zeit. Welche Lebensmittel sind wirklich gut für Körper und Geist? Wissenschaftler räumen in FOCUS mit Missverständnissen und Halbwahrheiten auf.
Update: You can use the following registry script to automate this process - just copy/paste the code block below into a text file called “Add Consolas to CMD.reg” and run it: Windows Registry Edit…
Do you play the odds? If you are a developer, the odds are that all things being equal you are not nearly as smart now before you read this blog as you will be once you have read it….