Query with GROUP BY and JOIN ... USING wrongly fails with "Column 'DEPTNO' is ambiguous" error. Here is the query:
Because of USING, the two deptno fields should be merged into one, and therefore deptno is not ambiguous. That query works in Oracle. Also note that
works correctly in Calcite, and has since
CALCITE-2227 was fixed.