1.Find all ancestor node from child.
SELECT parent.name from time_trees as parent,time_trees as node where node.lft between parent.lft and parent.rgt and node.original_id='0036994d34de9862-03-00000000000324'
2.Find all children from parent.
select node.name from time_trees as node,time_trees as parent where node.lft between parent.lft and parent.rgt and parent.name='projects' order by node.lft
3.Insert node.
SELECT @myRight := rgt FROM time_trees
WHERE name = 'Projects';
UPDATE time_trees SET rgt = rgt + 2 WHERE rgt > @myRight;
UPDATE time_trees SET lft = lft + 2 WHERE lft > @myRight;
INSERT INTO time_trees(name, lft, rgt) VALUES('new record', @myRight + 1, @myRight + 2);
分享到:
相关推荐
Negative Influence Minimizing by Blocking Nodes in Social Networks
Exact Analysis of Blocking Probability of Multi-class OBS with General Burst Size Distribution
WIRED SYNCHRONIZATION OF ANCHOR NODES IN A TDOA REAL TIME LOCATION SYSTEM How to synchronize anchor nodes using a wired scheme in an RTLS based on DecaWave’s DW1000 IC
algorithm achieves real-time performance by exploiting the GPU’s streaming architecture at all stages of kd-tree construction. Unlike previous parallel kd-tree algorithms, our method builds tree ...
Nodes are allocated in a separate zone, which allows faster allocation and constant-time deallocation of the entire syntax tree.
一种合适的传感器节点聚类算法可以提高传感器网络的能效。然而,集群需要额外的开销,比如集群头的选择和分配,以及集群的构建。摘要提出了一种基于孤立节点的无线传感器网络区域能量感知聚类方法,称为孤立节点区域...
To address this challenge, this paper proposes a novel skewness-aware clustering tree (SWC-tree) by clustering sensor nodes. Sensor nodes in a dense region will be put into the sam
mldonkey需要的nodes.dat
mldonkey nodes.dat~~~
3dmax中毒, ALC Nodes Found, 解决方法,亲测有效
在VB6下面如何使用TreeView添加nodes
nodes without parent pointers or threads suffer when traversal and modification are combined; maintaining a in-order doubly linked list is advantageous when traversal is very common; and right-...
内含100万个节点,可用于计算连通分量的各类算法(Union-Find、Quick-Find等)的测试。
Robustness of Dynamic Redundancy Nodes in Cascading Failure Networks
In many real complex networks such as the city road networks and highway networks, vehicles often have to pass through some specially functioned nodes to receive check-in like services such as gas ...
智慧方案
Computer scientists will find algorithmic considerations in Chapters 6 and 7, the full justification of which may be found in Chapters 2 and 4 respectively. Lastly, all readers can learn more about ...
On the Existence of Infinite Localizable Nodes in Stochastic Networks
Further, the harvested energy availability typically varies with time in a nondeterministic manner.While a deterministic metric, such as residual battery, suffices to characterize the energy ...
Design and Implementation of Programmable Nodes in Software Defined Sensor Networks