MySQL Forums
Forum List  »  Newbie

Re: Please help debug mysql insert query
Posted by: Peter Brawley
Date: September 20, 2021 10:13AM

Insert and Update don't combine, they're separate commands, and SUM() aggregates across rows ... I think you mean something like ...

[code[
insert into it.debt
set debt_id0,debt_total=2500, debt_payment=150, debt_payment_date=now();
update it_debt
set total paid=total_paid+150, debt_total_remaining=debt_remaining-150
where debt_id=0;
[/code]

Options: ReplyQuote


Subject
Written By
Posted
Re: Please help debug mysql insert query
September 20, 2021 10:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.