I have a select query which returns a list of data and I need to return all rows with the lowest common level.
SELECT code, level
FROM table
ORDER BY level
For Example
code | level
-----+------
A01 | 3
B56 | 3
J33 | 4
J35 | 4
K56 | 4
I would like to return all results with the lowest level value so in this case it would be
A01 | 3
B56 | 3
I have tried using MIN(level) but this only returns the top row.
1 Answer