Seaquel
SQL Server error code

SQL Server error 164

SQL Server raises error 164 at severity 15, which marks a problem with the query or data that you can correct.

Each GROUP BY expression must contain at least one column that is not an outer reference.
Msg164
Severity15
Group0–999

Source: Database Engine events and errors