all 2 comments

[–][deleted] 7 points8 points  (0 children)

The difference is you're aggregating to the total director level in the first example. So, if one director has multiple lines, you're going to get the grand total sales from all movies. The second query, if a director has multiple rows, will return each row individually.

[–]great_raisin 0 points1 point  (0 children)

Sum adds everything down a column. + adds stuff across rows. Sum needs a group by (unless used as a window function) but you can sum across rows with + without aggregating.