Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- *
- FROM
- vendors v
- INNER JOIN
- invoices i ON v.vendor_id = i.vendor_id
- WHERE
- v.vendor_id;
- /*------------------------------------------------------------------------------------------*/
- SELECT
- v.vendor_name,
- i.invoice_number,
- i.invoice_date,
- i.invoice_total - (payment_total + credit_total) AS balance_due
- FROM
- vendors v
- INNER JOIN
- invoices i ON v.vendor_id = i.vendor_id
- WHERE
- invoice_total - (payment_total + credit_total) <> 0
- ORDER BY balance_due DESC;
- /*------------------------------------------------------------------------------------------*/
- SELECT DISTINCT
- v.vendor_name,
- v.default_account_number AS default_account,
- gla.account_description
- FROM
- vendors v
- INNER JOIN
- general_ledger_accounts gla ON v.default_account_number = gla.account_number
- ORDER BY account_description , vendor_name;
- /*------------------------------------------------------------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement