I want to write a function looking into a query :
SELECT Customers.afid, orders1.customerid
FROM Customers INNER JOIN orders1 ON Customers.Customerid = orders1.customerid;
With the following condition :
If customers.afid = 3 , to update the order1.cusomerid to 124
Like that :
UPDATE Customers INNER JOIN orders1 ON Customers.Customerid = orders1.customerid SET orders1.customerid = 124
WHERE (((Customers.afid)=3));
Also, when customers.afid = 4, to update order1.customerid to 320
Etc etc
Can you help ?
SELECT Customers.afid, orders1.customerid
FROM Customers INNER JOIN orders1 ON Customers.Customerid = orders1.customerid;
With the following condition :
If customers.afid = 3 , to update the order1.cusomerid to 124
Like that :
UPDATE Customers INNER JOIN orders1 ON Customers.Customerid = orders1.customerid SET orders1.customerid = 124
WHERE (((Customers.afid)=3));
Also, when customers.afid = 4, to update order1.customerid to 320
Etc etc
Can you help ?