How would I properly write the following INSERT using LIKE?
provider = provider
cursor.execute("""INSERT INTO raw_financials (provider, vendor_id)
VALUES (%s, %s)""",
((SELECT provider FROM main_app_provider
WHERE provider LIKE %s%, %provider), vendor_id)
For example, with the above LIKE statement, “Apple” would match “Apple Inc.”.
Use the
INSERT ... SELECT ... FROMvariant of the INSERT command: