Meek
Meek

Reputation: 87

GROUPing two columns in SQL

Could someone explain to me why you have to group two columns together here? Link to page with code etc.

enter image description here

Upvotes: 0

Views: 54

Answers (1)

Christopher Padfield
Christopher Padfield

Reputation: 1299

Because you want the highest of unique(customer, date).

If a customer orders twice on Monday and once on Tuesday you want the output to be their highest value order from Monday and their order from Tuesday.

Upvotes: 1

Related Questions