I can write a query that queries the result of another query, but I can't store a query and then pass that somewhere to query from.
Check the example at the beginning of https://www.postgresql.org/docs/13/queries-with.html
I can write a query that queries the result of another query, but I can't store a query and then pass that somewhere to query from.