BEGIN SET new.nodeId=(SELECT IF(ISNULL(id),1,id+1) FROM (SELECT MAX(id) AS id FROM function)tmp); END 自己写的触发器 BEGIN SET new.sort_index=(SELECT IF(ISNULL(id),1,id+1) FROM (SELECT MAX(news_item_id) AS id FROM news_module_item)tmp); END BEGIN SET new.sort_index=(SELECT IF(ISNULL(id),1,id+1) FROM (SELECT MAX(pic_and_text_item_id) AS id FROM picandtext_module_item)tmp); END
标签:tmp,触发器,SET,BEGIN,item,mysql,id,SELECT From: https://www.cnblogs.com/lbzwd/p/17039547.html