You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12345678910111213141516 |
- CREATE TABLE invoices_copy AS
- SELECT *
- FROM invoices;
-
- CREATE TABLE old_invoices AS
- SELECT *
- FROM invoices
- WHERE invoice_total - payment_total - credit_total = 0;
-
- CREATE TABLE vendor_balances AS
- SELECT vendor_id, SUM(invoice_total) AS sum_of_invoices
- FROM invoices
- WHERE (invoice_total - payment_total - credit_total) <> 0
- GROUP BY vendor_id;
-
- DROP TABLE old_invoices;
|