Create two Delete triggers, in the same table

0

I currently have a disparador that updates when I delete a data from the table pago_detalles

update pagos a
    join pago_detalles di
      on di.idpago = a.id
      set a.pagado = a.pagado - di.monto

but do not let me create another trigger delete then I must put it there but I do not know how I could do it. the other trigger is the same in delete but it is:

update pagos a
    join pago_detalles di
      on di.idpago = a.id
      set a.status = 1

How can I join them so that it is in a single trigger DELETE ?

    
asked by DoubleM 16.07.2018 в 21:09
source

1 answer

1

You can separate the columns with commas like this:

update pagos a
join pago_detalles di
  on di.idpago = a.id
  set a.pagado = a.pagado - di.monto,
      a.status = 1
    
answered by 16.07.2018 в 21:11