Is it possible to pass sub query to `from`?

I have a db.select().from() and I need to pass a nested query into that from.
        SELECT g.id, g.name, g.background_image, json_agg(p) as platforms
        FROM (
            SELECT g.*
            FROM games g
            JOIN games_to_platforms gtp on gtp.game_id = g.id
            JOIN platforms p on gtp.platform_id = p.id
            WHERE p.slug = 'pc'
        ) as g
Was this page helpful?