but those results could not possibly have come from that query, because those results have a dozen columns, whereas the query is written to return only 2 columns, building_id and name
They’re not the results, from what I can make out of the tiny screen-shot that’s the table contents showing that there’s only one row where project_id = 1. Presuming that’s the assets table, of course.
No this is not a better solution. You should only query from the database what you need and not read all data because you do not know how to write the query and then try to filter the data with the application code.
But we cannot help you as long as you do not tell us your database structure and what your final approach is.