Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  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.


Not as terse as I imagined it could be, but I really didn't expect that it could be done this way. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: