We have a table `Things` with instances belonging to table `Projects` via `thing.project_id`.

When querying an instance of `Things`, we are returning a json representation of the parent `Project` record as a value on that instance.

Currently it looks like:

```
SELECT t.id,
(
  SELECT row_to_json(a.*)
  FROM (
    SELECT p.id, p.name
  ) AS a
) AS project
FROM "Things" t
INNER JOIN "Projects" p ON p.id = t.project_id
WHERE t.id = ?

```

This works fine, but it seems like it could be simplified.

Is there a way to get rid of the need for an intermediate variable (`a` in this example) while retaining clarity?