5 Ways to Convert a List to a String in DuckDB

If we have a list in DuckDB, and we want to convert it to a string, there are a number of options on the table. Basically, what we want to do is combine/concatenate all elements into a single string. Let’s take a look at five ways to convert a list to a string in DuckDB.

Read more

3 Ways to Get the Minimum Value from a List in DuckDB

Most SQL developers are familiar with the min() function that allows us to get the minimum value from a data set. But if we want to get the minimum value from a list, passing the list to the min() function won’t quite cut it. But don’t despair! Finding the minimum value in a list is just as easy. Here are three ways to do it. And yes, we can even use the min() function if we want.

Read more

4 Ways to Concatenate 3 or More Lists in DuckDB

If you’ve ever used list_concat() or any of its aliases to concatenate lists in DuckDB, you may have been disappointed to find out that it only concatenates two lists. Any more than two lists and it returns an error. At least that’s how it works at the time of this writing.

Fortunately, there are some alternatives we can use in order to concatenate three or more lists.

Here are four ways to concatenate three or more lists in DuckDB.

Read more

Calculating Time Differences in DuckDB

DuckDB has emerged as a powerful analytical database system designed for fast in-memory data processing. One common analytical task involves calculating time differences between events—whether measuring intervals between transactions, tracking service response times, or analyzing temporal patterns in time series data.

This article provides an exploration of calculating time differences in DuckDB, covering both basic and slightly more advanced techniques.

Read more