SQL: Illegal GROUP BY in subquery (Error 1828)

When using one of the six operators +, -, *, /, < and >, there can be only one row of output. For more information, see SELECT - SQL.