I am trying to update a table according to values from an inner join on the same table and another table.
Below is the query :-
update coin_txn_normalization cn
SET cn.is_merchant_pay_rel='H'
where cn.coin_txn_id IN(
SELECT ctn.coin_txn_id
FROM hold h
INNER JOIN coin_txn_normalization ctn
ON h.txn_id = ctn.coin_txn_id
);
I am getting the following error
SQL Error (1093): Table 'cn' is specified twice, both as a target
for 'UPDATE' and as a separate source for data
Affected rows: 0 Found rows: 0 Warnings: 0 Duration for 0 of 1 query: 0.000 sec.
How should I solve this error. Let Me know if anything else is needed.