INSERT working but UPDATE not working in Database Update Tool
This SQL Query runs fine for me from within the Databse Update Tool:
INSERT INTO app_fd_x2_ref_sum (c_request_category, c_resource_type, c_request_amount, c_codes, c_monthYear, dateModified, dateCreated)
SELECT c_Category_1, c_resource_type, c_Amt_1, c_Code_1, '#variable.monthYear#', NOW(), NOW()
FROM app_fd_x2_icontacts JOIN app_fd_x2_accounts
ON app_fd_x2_icontacts.c_Church_Agency_1=app_fd_x2_accounts.c_resource_name
WHERE (app_fd_x2_icontacts.c_Amt_1 IS NOT NULL) OR (app_fd_x2_icontacts.c_Code_1 IS NOT NULL)
However this SQL Query run from within the Database Update Tool, where I am trying to set one column equal to another, does not :
UPDATE app_fd_x2_ref_sum t1, app_fd_x2_ref_sum t2
SET t2.client_amt=t1.request_amount
WHERE t2.resource_type='Client';
The log shows the error:
ERROR 26 Sep 2017 11:40:19 org.joget.apps.app.lib.DatabaseUpdateTool - Error executing plugin
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE app_fd_x2_ref_sum t1, app_fd_x2_ref_sum t2
SET t2.love_inc_amt=t1.request' at line 4
I have tried various forms of this Query and it always errors.
What am I missing?
Thanks, Bill