3 ms·
I'd like there to be a function or macro for a bunch of joins, say DEFINE products_by_order AS orders o JOIN order_items oi ON o.order_id = oi.order_id JOI
by emmelaich 1y ago
I'd like there to be a function or macro for a bunch of joins, say
DEFINE products_by_order AS orders o JOIN order_items oi ON o.order_id = oi.order_id JOIN products p ON oi.product_id = p.product_id
You could make it visible to the DB rather than just a macro so it could optimise it by caching etc. Sort of like a view but on demand.
- icedchai 1y agoSounds like a CTE?