Dim jb1 As New SQLJoinTableBuilder("查询表1","表A") jb1.AddTable("表A","第一列","表B","第一列",JoinModeEnum.right) jb1.AddExp("父表第一列","{表B}.第一列") jb1.AddExp("子表第一列","{表A}.第一列") jb1.AddExp("个数", "iif({表A}.第一列 is null, 0, 1)") jb1.build Dim g As New GroupTableBuilder("统计表1", DataTables("查询表1")) g.Groups.AddDef("父表第一列", "第一列") g.Totals.AddDef("个数") g.Build() MainTable = Tables("统计表1")