sql - mySQL - UPDATE TRIGGER, how to compare a .NEW value to another piece of data in the same row -


What is a trigger statement I'm trying to do before the row value is updated?

  DELIMITER   

$$ creating a trigger back trail First update on the loan for each round IF (New Payment '& gt; OLD.debt) then insert into Table 1 values ​​(INSERT); end if; END $$ DELIMITER;

The table (loan) structure is 3 columns

Paid Custom

If the amount paid I need more triggers to work than I'm DBT.

I have tried to use OLD.DEBT (but this is of no use as the loan amount is not being changed during the update)

I also

Consider using a selection statement as
  as IF (New Payment '> Select Credit from Loan ...?) Then  

But again, there is no identifier, then select the row using CUSTNO or DEBT, because none of them change in the initial UPDATE statement Used to be.

  debt set date of payment = (amount payment) WHERE custno = (customer number);  

Any help would be appreciated. Thank you.

before updating to later updates And your trigger should work


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -