Skip to content
Advertisement

Sql / Finding Min Max values for each elements of another column

Learning sql, as per title trying to print min and max values of a given column (sal) for each values in another (nodept). Using this query so far:

Which works but only returns absolute min max and not min max for every entry in nodept. Documentation says it should be a simple matter of adding GROUP BY to the query but i fail to find the syntax for it.

Ty for the input.

Advertisement

Answer

It sounds like you just want

If you want a row for each min and max per nodept then you want to add a filter to your subqueries:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement