有三张表
分别是水果的种类、产地、颜色,
能不能生成汇总表,该如何设置。
[此贴子已经被作者于2024/12/19 9:38:47编辑过]
For Each dr As DataRow In DataTables("产地").Select("水果id<>'' and 水果id is not null")
Dim dr1 As DataRow = DataTables("颜色").Find("水果产地id='" & dr("水果产地id") & "' and 水果产地='" & dr("产地") & "'")
If dr1 IsNot Nothing Then
For Each 颜色 As String In dr1("水果颜色").Split("|")
Dim adr As DataRow = DataTables("汇总").AddNew
adr("水果id") = dr("水果id")
adr("水果") = dr("水果")
adr("水果产地id") = dr("水果产地id")
adr("水果产地") = dr("产地")
adr("水果颜色") = 颜色
Next
End If
Next