If for some reason you are not guaranteed, you get a positive amount every time you insert a new row, take an absolute value and multiply it by -1
INSERT INTO refund (id,amount) SELECT id, -1 * ABS(amount) FROM `transaction`
Otherwise, the ABS() part ABS() not needed.
INSERT INTO refund (id,amount) SELECT id, -1 * amount FROM `transaction`
source share