3 ms·
FROM ( (with baz as (from baz101(500)), bar as (from bar1(arg1, arg2)) from foo ) UNION ALL (with
by geysersam 2y ago
FROM (
(with
baz as (from baz101(500)),
bar as (from bar1(arg1, arg2))
from foo
)
UNION ALL
(with
baz as (from baz201(300)),
bar as (from bar2(arg3, arg4))
from foo
)
UNION ALL
...
)
SELECT *;
When you pass table arguments to a macro, don't pass them as a parameter to the macro, instead make a subquery and give it the name that `foo` expects.
- typ 2y agoNot as terse as I imagined it could be, but I really didn't expect that it could be done this way. Thanks!