How to create a trigger in the concatenation of auto_increment value column and a column that has a default value
DELIMITER $$
CREATE DEFINER=`root`@`localhost` TRIGGER `grade_one_BINS`
BEFORE INSERT ON `grade_one` FOR EACH ROW
set new.student_no = concat(new.letter, ' - ',new.num)
there is a problem with the concatenation of a num column that has an auto-increment value as the trigger is before the insert, because it will show the value 0, since auto-increment is still 0 until you enter some values ... can you help me ?? ?
+3
source to share