日期:2014-05-20 浏览次数:20808 次
Dim o As New DataTable
o = OLDMJ.DataSource
Dim n As New DataTable
n = NEWMJ.DataSource
Dim vDRnull As DataRow = n.Rows.Add
Dim leftdata = From oldMJs In o Group Join newMJs In n On oldMJs("ZL") Equals newMJs("ZL") Into Group Let G = If(Group.FirstOrDefault Is Nothing, vDRnull, Group.FirstOrDefault)
Select New With {.ZL = oldMJs("ZL"), _
.oldMJ = oldMJs("MJ"), _
.oldML = oldMJs("ml"), _
.newMJ = G("MJ"), _
.NEWML = G("ml")}
Dim vdnull As DataRow = o.Rows.Add
Dim rightdata = From newmj In n Group Join oldtmj In o On newmj("ZL") Equals oldtmj("ZL") Into Group Let b = If(Group.FirstOrDefault Is Nothing, vdnull, Group.FirstOrDefault)
Select New With {.ZL = newmj("ZL"), _
.oldMJ = b("MJ"), _
.oldML = b("ml"), _
.newMJ = newmj("MJ"), _
.NEWML = newmj("ml")}
Dim aks = rightdata.AsEnumerable.Union(leftdata).CopyToDataTable '.Distinct()
Dim jk = (From ak In aks Select New With _
{.ZL = ak("ZL"), _
.newMJ = ak("newMJ"), _
.newML = ak("NEWML"), _
.oldMJ = ak("oldMJ"), _
.oldML = ak("oldML")})
11 21355.16 941225.82 22314.23 816552.90
08 5357.00 1125986.12 4742.00 638780.93
01 43894.04 1099675.87 33210.10 808405.76
20 11929.86 355417.70 11405.00 260202.66
13 52.00 15088.63 52.00 17969.27
03 23716.00 1035490.06 21823.00 731774.87
07 25673.87 779286.42 24321.77 787685.82
09 2574.00 180685.13 3847.00 163668.39
24 1484.00 14995.32 1301.00 13336.89
23 1357.00 22786.07 1399.00 19230.71
15 5181.00 282145.40 6541.65 191340.64
04 8022.42 266645.47 7648.16 257231.28
14 2360.00 129164.64 2360.00 104889.31
41 6912.00 106418.14 6912.00 133493.39
05 614.00 39913.02 1617.35 27634.54
02 7971.00 404396.23 10993.00 383445.53
06 1474.00 90243.27 2345.00 82909.70
32 2985.00 147905.82 1939.00 97435.21
10 16727.00 582638.43 21749.00 480536.74
12 1453.00 116433.44 1493.87 85583.27
26 43851.00 745790.42 45182.55 450968.87
39 1348.00 32340.18 1617.00 18908.99
17 6439.00 130699.34 10617.65 136772.71