select rgt, lft from #this.table# where id= select * from #this.table# where (lft between and ) order by lft ASC select lft from #this.table# where id= update #this.table# set rgt=rgt+2 where rgt > ; update #this.table# set lft=lft+2 where lft > ; insert into #this.table# (lft, rgt, parentId , #arguments.data[i][1]# ) values( , , , ); insert into #this.table# (lft, rgt, parentId , #arguments.data[i][1]# ) values( , , , ); select id, lft, rgt from #this.table# where id= delete from #this.table# where ((id=) or (lft between and )); update #this.table# set rgt=rgt- where rgt > ; update #this.table# set lft=lft- where lft > ;