Skip to content
Advertisement

Sql query with max value in where condition

I have a query which should return one row if the conditions are met. This query compares columns from 3 tables and should use the max value of DEGREE_HIERARCHY since there can be more than one value. It then should use the max(DEGREE_HIERARCHY) in the where clause to satisfy the conditions.

The code I have so far has the error:

Any help is appreciated thanks!

Advertisement

Answer

Unaggregated columns in the SELECT list must be present in the GROUP BY clause… that you forgot to add. Just add at the end:

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