I then asked a follow-up question about how I could made this work while also grouping the results. It (of course) knew what to do there too. But check out how the conversation ended! I thought I was just doing a polite "thank you", but I got a bonus lesson!
15 minutes reading docs on how "common table expressions" work, and I still can't figure out how or whether they'll solve my problem.
1 minute with ChatGPT, and it says "CTEs will work. Here's the modified code."