在命令窗口执行:
Dim s As String
For Each js As String In DataTables("报名表").GetUniqueValues("","竞赛名称")
s = "2013年" & js & vbcrlf
For Each dq As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "'","区")
s = s & dq & vbcrlf
s = s & "领队:"
For Each ld As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","领队")
s = s & ld & ","
Next
s= s.trim(",") & vbcrlf
s = s & "教练:"
For Each jl As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","教练")
s = s & jl & ","
Next
s= s.trim(",") & vbcrlf
s = s & "队员:"
For Each dy As String In DataTables("报名表").GetUniqueValues("竞赛名称 = '" & js & "' And 区 = '" & dq & "'","姓名")
s = s & dy & ","
Next
s= s.trim(",") & vbcrlf
Next
Next
output.show(s)
就得到你要的数据