# Require clarity in SQL course - creating copy of table

**URL:** https://forum.codewithmosh.com/t/require-clarity-in-sql-course-creating-copy-of-table/28921
**Category:** SQL
**Created:** [September 24, 2024, 2:53pm UTC](https://forum.codewithmosh.com/t/require-clarity-in-sql-course-creating-copy-of-table/28921 "2024-09-24T14:53:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rekt-22](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rekt-22](https://forum.codewithmosh.com/u/rekt-22)
#### Post date: [September 24, 2024, 2:53pm UTC](https://forum.codewithmosh.com/t/require-clarity-in-sql-course-creating-copy-of-table/28921/1 "2024-09-24T14:53:41Z")

</div>

Hello!

I’m doing the exercise for ‘creation copy of a table’ but I could not insert the data because I used

```auto
create table invoice_archive2 as
SELECT * 
FROM clients c
JOIN invoices inv
ON c.client_id = inv.client_id
WHERE payment_date IS NOT NULL

```

instead of

```auto
create table invoice_archive2 as
SELECT * 
FROM clients c
JOIN invoices inv
USING (client_id)
WHERE payment_date IS NOT NULL

```

I was under the assumption that USING (client\_id) is a shorthand for what I did, so why did it not work? Can someone assist in clarification? I’d very much appreciate it.

---

<div class="post-metadata">

### Author: ![theorion](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/theorion/32/7783_2.png) [@theorion](https://forum.codewithmosh.com/u/theorion)
#### Post date: [September 24, 2024, 5:01pm UTC](https://forum.codewithmosh.com/t/require-clarity-in-sql-course-creating-copy-of-table/28921/2 "2024-09-24T17:01:25Z")

</div>

Similar but not a shorthand in some cases. The key difference being ON will map the tables together using 2 explicitly stated values.

Whereas USING has to have 2 values that are exactly the same on both tables, and not just named the same but the same values. This is where the trouble lies if they are named the same but different.

But in some cases yes a shorthand, however ON is much safer and more flexible generally. Using is cleaner syntax but limited use case.
