I already have a solution for this, but it's not elegant. I'm curious if other people have "cleaner" solutions. My goal is less to make this specific problem better, but more to find a nicer way to ...
A common SQL habit is to use SELECT * on a query, because it’s tedious to list all the columns you need. Plus, sometimes those columns may change over time, so why not just do things the easy way? But ...