One of the things that baffles me with SQL is how some things make complete sense, but when you apply the same logic, it just doesn't work. For example: select * from payments where amount > 20; This works and it makes sense that it works. Then you try this: select * from payments where avg(amount); And you get a grouping error. Which makes no sense. Why shouldn't you be able to make that work?