CREATE SEQUENCE "IMCYC"."_SYS_SEQUENCE_594237_#0_#" RESET BY select ifnull(MAP( mod((max( "ID") - (1) ),1),  0, max("ID") +1,  max("ID") - mod((max( "ID") - (1)), 1 ) +1 ) , 1) from "IMCYC"."DA_CHAN"