---
title: "USING clause"
description: "The USING clause specifies join columns by name when both tables share identically named columns, joining on equality and returning a single copy of each shared column."
canonical: "https://motherduck.com/glossary/using-clause/"
related:
  - title: "USE | MotherDuck Docs"
    url: "https://motherduck.com/docs/sql-reference/duckdb-sql-reference/duckdb-statements/use/"
  - title: "DuckLake Architecture Deep Dive"
    url: "https://motherduck.com/blog/ducklake-architecture-deep-dive/"
  - title: "Running dual execution (or hybrid) queries | MotherDuck Docs"
    url: "https://motherduck.com/docs/key-tasks/running-hybrid-queries/"
---

# USING clause

> The USING clause specifies join columns by name when both tables share identically named columns, joining on equality and returning a single copy of each shared column.

## Overview
The `USING` clause is shorthand for specifying join conditions when two tables share one or more identically named columns. Instead of writing out a full `ON` equality condition, `USING (col)` joins on that column directly:

```sql
SELECT *
FROM orders
JOIN customers USING (customer_id);

-- equivalent to:
SELECT *
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;
```

<glossary-callout guide="duckdb-cheatsheet-full" />

## USING vs ON: the key difference in output
The two forms aren't purely stylistic -- they behave differently in the result set. `USING (customer_id)` produces a single, unqualified `customer_id` column in the output. `ON o.customer_id = c.customer_id` keeps both `orders.customer_id` and `customers.customer_id` as separate columns, which then need explicit qualification (or exclusion) if selected with `SELECT *`, since both tables have a same-named column.

## Multiple columns
`USING` can list multiple shared columns to join on all of them simultaneously:
```sql
SELECT *
FROM sales
JOIN inventory USING (store_id, product_id);
```

## USING vs NATURAL JOIN
`USING` requires you to explicitly name the join columns, while `NATURAL JOIN` infers them automatically from every column name the two tables happen to share. `USING` is the safer, more maintainable middle ground: it avoids repeating a fully-qualified equality condition like plain `ON` requires, but it doesn't silently change behavior if an unrelated same-named column is added to either table later, since the join columns are pinned explicitly in the query text.

## DuckDB notes
DuckDB supports `USING` across all join types (`INNER`, `LEFT`, `RIGHT`, `FULL`, and even `ASOF JOIN`, where `USING` treats the last listed column as the inequality condition rather than an equality). This makes `USING` a genuinely useful, DuckDB-idiomatic pattern beyond just a stylistic shortcut for ordinary equi-joins.