Troubleshooting errors | BUS 104 – SQL Exam

There's 3 common errors that students run into when working with SQL:

  • ERROR: not a single-group function
  • ERROR: ambiguous column name
  • ERROR: syntax error

Let's go one-by-one and see how we can correct each!

ERROR: not a single-group function

Simply put, you forgot your GROUP BY statement.

In GROUP BY | SQL in 30 Minutes, we discussed the golden rule of GROUP BY statements:

Whenever you have field(s) and aggregate function(s) in your SELECT statement, you must include all field(s) in your GROUP BY statement.

So, if you get this error, chances are you didn't write a GROUP BY statement with all the field(s) of your SELECT statement.

For example, if I had the following SQL statement...

PAID CONTENT

This is the end of the preview. To unlock the rest, get the SQL Cram Kit or Lifetime Access.

Already purchased? Click here to log in.

Leave a Comment