Examples that Demonstrate DuckDB’s MIN() Function

DuckDB has a min() function just like most RDBMSs that returns the minimum value from a set of values. However, DuckDB’s implementation also allows us to return the bottom n minimum values, which is not something we see in most other RDBMSs.

This article presents some examples of DuckDB’s implementation of the min() function, so as to demonstrate its basic usage, as well as its bottom n functionality.

Continue reading

Using a CTE with an UPDATE Statement in SQL Server

In SQL Server, Common Table Expressions (CTEs) are often used for readability and simplifying complex queries. While CTEs are most commonly used when running a SELECT query, we can also use CTEs to perform updates with the UPDATE statement. This can be useful when we need to reference the same set of data multiple times or want to update records conditionally.

Continue reading