4 comments

[ 3.2 ms ] story [ 26.1 ms ] thread
I’m going to make a search site, but I’ll just call google under the hood. Host it on GitHub and call it open source.
It's failing.

> list the oldest person in each household, their full name and age and how many people are in the household

Maybe I didn't express that nicely, but it's output is:

> select max(age) as age, full_name, count(*) as num_people from household group by household;

The full_name won't necessarily be for the oldest person (or it'll fail because it's not in the group by). That's the whole tricky part.