Here’s my code:
I checked there is no mistake, but When I execute it throws an error:
use sql_invoicing;
create table invoices_archived AS
select
i.invoice_id,
i.number,
c.name AS client,
i.invoice_total,
i.payment_total,
i.invoice_date,
i.payment_date
from invoices i
Join clients c
USING (client_id)
WHERE payment_date is NOT NULL