Dim dt_s As DataTable = DataTables("测试2") Dim dt_d As DataTable = DataTables("测试3") dt_d.DataRows.Clear For Each ary() As String In dt_s.GetValues("股piao代码|日期") Dim fdr As DataRow = dt_s.Find("股piao代码 = '" & ary(0) & "' and 日期 = #" & ary(1) & "#", "时间 desc") Dim ndr As DataRow = dt_d.AddNew ndr("股piao代码") = fdr("股piao代码") ndr("主力流入") = fdr("主力流入") Next