DuckDB has a arg_min_null()
function that works in a similar way to the arg_min()
function. That is, it finds the row with the minimum value in one column and returns the corresponding value from another column at that row.
But there’s also a difference between these two functions. The main difference is in the way they deal with NULL values. Also, arg_min_null()
only accepts two arguments, whereas arg_min()
accepts an optional third argument. Additionally, there aren’t any aliases for arg_min_null()
at the time of writing (arg_min()
has a couple of aliases).
In this article we’ll look at how arg_min_null()
works, and we’ll compare it with arg_min()
to see how each function handles NULL values.