Last active
March 9, 2018 09:37
-
-
Save remcotolsma/f358dbd65dd47e855c67a9f8f29514e9 to your computer and use it in GitHub Desktop.
Orbis Projects invoices conversion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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