Skip to content

Returns the value of one column associated with the maximum value of another column.

func.max_by(get_column(table, 'name'), get_column(table, 'salary'))
func.max_by(get_column(table, 'name'), get_column(table, 'salary'))
┌───────┐
│ Alice │
└───────┘
MAX_BY(<name>, <salary>)
SELECT MAX_BY(name, salary) FROM employees;
┌───────┐
│ Alice │
└───────┘