Firebird Db 将图表帐户记录存储在表中:
CREATE TABLE CHARTACC
(
ACCNTNUM Char(8) NOT NULL, -- Account ID (Primary Key)
ACCPARNT Char(8), -- Parent ID
ACCCOUNT Integer, -- account count
ACCORDER Integer, -- order of children in nodes
ACCTITLE varchar(150),
ACDESCRP varchar(4000),
DTCREATE timestamp -- date and time of creation
)
我必须编写查询,它只从表中选择最后一个节点,例如没有子节点的节点(child2、child3、subchild1、subchild2、subchild3 和 subchild4)。