Create trigger to generate sequence number in MySQL

preview_player
Показать описание
@SoengSouy, Create trigger to generate sequence number in MySQL
--------------------------------------------
Script:
BEGIN
INSERT INTO sequence VALUES (NULL);
SET NEW.rec_id = CONCAT("DEB_", LPAD(LAST_INSERT_ID(), 10, "0"));
END
--------------------------------------------
--------------------------------------------
--------------------------------------------
--------------------------------------------
--------------------------------------------
--------------------------------------------
--------------------------------------------
Follow Soeng Souy on:
-------------------------------------------
Enjoying the content?
=================
--------------------------------------------
-------------------------------------------
-------------------------------------------
-------------------------------------------
-------------------------------------------
Рекомендации по теме
Комментарии
Автор

hello, thank you for this tuto i think it could help me because i have a table that have id, name, account_number so the id is a primary key and already auto-increment i can't do the auto_increment for the account_number

cadeaulucmann
Автор

Thanks a lot Bro, I was stack and you have helped

bravemitambo