Skip to content

Instantly share code, notes, and snippets.

@remcotolsma
Last active March 9, 2018 09:37
Show Gist options
  • Save remcotolsma/f358dbd65dd47e855c67a9f8f29514e9 to your computer and use it in GitHub Desktop.
Save remcotolsma/f358dbd65dd47e855c67a9f8f29514e9 to your computer and use it in GitHub Desktop.
Orbis Projects invoices conversion.
INSERT
INTO
orbis_projects_invoices ( project_id, invoice_number )
SELECT
project.id,
project.invoice_number
FROM
orbis_projects AS project
LEFT JOIN
orbis_projects_invoices AS invoice
ON project.id = invoice.project_id AND project.invoice_number = invoice.invoice_number
WHERE
project.invoice_number IS NOT NULL
AND
project.invoice_number != ''
AND
invoice.id IS NULL
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment