SQL HowTo: Writing a while-loop directly in a query, or 'An Elementary Three-Way'
There is periodically a task to search for related data by a set of keys until we accumulate the required total number of records. The most 'realistic' example is to display the 20 oldest tasks listed for employees (for instance, within a single department). This topic is often required for various management dashboards with brief overviews of work areas. In this article, we will discuss the implementation in PostgreSQL […]
