我现在的做法是,在FT中执行,通过TbModD中的WLID集合,找到它们在TbWL表中的WBSID的集合,然后再去WBS表中,找到这些WBSID的上级节点。
这样实际执行下来,7000行数据,测试用时3秒左右。
但如果直接在ACEESS中执行SQL,别说3秒了,300秒也搞不定。
dim a as list(of string) = datatables("TbModD").getvalues("WLID")
dim b as list(of string)
for each ai as string in a
dim dr as datarow = datatables("TbWL").find("ID = '" & ai & "'")
if dr isnot nothing then
dim r as datarow = datatables("TbWBS").find("ID = '" & dr("WBSID") & "'")
if r isnot nothing andalso b.contains(r("C")) then
b.add(r("C"))
end if
end if
next
这样,就得到了诸如1.4.5.6,1.2.3.4这样的集合,然后去分解得到1,1.4,1.4.5,1.4.5.6,1.2,1.2.3,1.2.3.4……这样的上级节点。
再就可以在TbWBS中找到它们对应的ID了
[此贴子已经被作者于2018/6/22 8:53:21编辑过]