MySQL Forums
Forum List  »  Italian

Trigger con query
Posted by: Daniele Napoli
Date: November 20, 2020 04:59AM

Salve a tutti.
ho la necessità di creare un trigger su "before insert" che mi prenda il numero massimo della tabella nometabella con un query e in insert mi inserisca questo numero come nuovo valore.
non riesco a livello di sintassi:

SELECT COALESCE(MAX(NUMERO_PRATICA),0)+1 AS NUMERO FROM MOVIMENTI
MOVIMENTI NEW.NUMERO=NUMERO

dovrei fare qualcosa del genere ma non so come scriverlo.

Options: ReplyQuote


Subject
Views
Written By
Posted
Trigger con query
483
November 20, 2020 04:59AM


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.