Monday, September 25, 2017

How to Write Efficient TOP N Queries in SQL

DZone Database Zone
How to Write Efficient TOP N Queries in SQL
How to Write Efficient TOP N Queries in SQL

A very common type of SQL query is the TOP-N query, where we need the "TOP N" records ordered by some value, possibly per category. In this blog post, we're going to look into a variety of different aspects to this problem, as well as how to solve them with standard and non-standard SQL.

These are the different aspects we'll discuss:

No comments:

Fun With SQL: Functions in Postgres

DZone Database Zone Fun With SQL: Functions in Postgres In our previous  Fun with SQL  post on the  Citus Data  blog, we covered w...