I\'ve written a query returning rows associating Customers and Salespeoeple.
Note that the query joins several database tables. And note that not all c
Assuming your first table is named customers
and those customers without a salesperson have an s_id
of NULL
UPDATE invoices JOIN customers USING (c_id)
SET invoices.s_id = customers.s_id, invoices.s_name = customers.s_name
WHERE customers.s_id IS NOT NULL;
I suggest testing in development or running a SELECT
query using the JOIN
above first to ensure the results.