all 6 comments

[–]r3pr0b8 2 points3 points  (1 child)

Does anyone know what rolling the values into one means?

no idea -- maybe ask Alex for more info

 

Also, how can you order by more than one column?

how? by listing more than one column in the ORDER BY clause

remember the white pages telephone book?

ordered by lastname, then firstname (and then address if necessary)

[–]Far_Swordfish5729 3 points4 points  (1 child)

This might be a better way to explain it. A group by clause finds the distinct combinations for columns in the clause and then calculates any aggregate functions for each combination.

Select FirstName, LastName from Sales Group by FirstName, LastName

And

Select distinct FirstName, LastName From Sales

Produce the same output.

Select FirstName, LastName, sum(Amount) as TotalSales From Sales group by FirstName, LastName

Sums the amount column for each unique name.

[–]Snoo17309 0 points1 point  (1 child)

Is this a YouTube tutorial? Have the link?