Recently we introduced support of the INNER JOIN ON syntax. However, INNER JOIN has a special case INNER JOIN USING(), which we also need to implement.
The USING clause is a shorthand way to specify the join condition when both tables share a column with the exact same name that you want to join on. It's an alternative to the more verbose ON clause, but only applicable under this specific condition.
The key characteristic of USING is that it deduplicates the joining column(s) in the output. When you use SELECT * with INNER JOIN ... USING, the common column specified in the USING clause will appear only once in the result set. But at the same time you can directly access each column: SELECT a.c1, b.c1 FROM a INNER JOIN b USING(c1).
Recently we introduced support of the
INNER JOIN ONsyntax. However,INNER JOINhas a special caseINNER JOIN USING(), which we also need to implement.The
USINGclause is a shorthand way to specify the join condition when both tables share a column with the exact same name that you want to join on. It's an alternative to the more verboseONclause, but only applicable under this specific condition.The key characteristic of
USINGis that it deduplicates the joining column(s) in the output. When you useSELECT *withINNER JOIN ... USING, the common column specified in theUSINGclause will appear only once in the result set. But at the same time you can directly access each column:SELECT a.c1, b.c1 FROM a INNER JOIN b USING(c1).