When it comes to concatenating lists in DuckDB, we can use the list_concat()
function (and its aliases), or the list concatenation operator (||
). Often when we have a choice like this, we can use either option interchangeably. But that isn’t quite true in this case.
There’s an important difference between list_concat()
and the ||
operator in DuckDB, and it all comes down to how it handles NULL values.