Wraps two SQL sub-queries in a single SELECT ... JOIN ... USING ...
statement. Both sub-queries are used as derived tables, so they can be any
valid SELECT statements.
Arguments
- q1
a character string with the left-hand side
SELECTsub-query- q2
a character string with the right-hand side
SELECTsub-query- using
a character string with the column(s) to join on, as expected after the
USINGkeyword (e.g."id"or"(id, version)")- type
the join type, passed verbatim before the
JOINkeyword (e.g."LEFT","INNER","FULL","ANY LEFT"). Default:"LEFT".- select
a character string with the columns to select. Default:
"*". Columns can be qualified with the sub-query aliases (seea1/a2) to disambiguate non-key columns present on both sides.- a1
alias given to the left-hand side sub-query. Default:
"l".- a2
alias given to the right-hand side sub-query. Default:
"r".