MIN_BY function returns the value of
arg column at the row in which the
val column is minimal.
If there is more than one minimal values in
val, then the first will be used.
| ||The column from which the value is returned.|
| ||The column that is search for a minimum value.|
For this example, we will again use the
prices table that was created above for the
MIN function. The values for that table are below:
In this example below,
MIN_BY is used to find the item with the lowest price.
SELECT MIN_BY(item, price) FROM prices