DuckDB has a min_by()
function that’s similar to the min()
function, but with a twist. While the min()
function simply returns the minimum value, the min_by()
function finds the row with the minimum value in one column and returns the corresponding value from another column at that row.
Here are some examples that demonstrate how it works.
Continue reading