if new.parent_seq > 0 then
select ifnull(max(depth),-1) + 1 INTO @seqno from cate_table where type = new.type and parent_seq = new.parent_seq;
else
select ifnull(max(depth),-1) + 1 INTO @seqno from cate_table where type = new.type and parent_seq is null;
end if;
null 관련 처리로 분기하였는데
이것을 한라인에서 어떻게 처리하는법 없을까요?
|