以交互方式,您只需运行 Join 平台
表==>加入
并指定根据时间进行匹配。
下面是一个与交互操作执行相同操作的脚本
Names Default To Here( 1 );
// Create the first table
dt1 = New Table( "Table 1",
Add Rows( 4 ),
New Column( "Time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [18, 18, 19, 19] )
),
New Column( "Tool",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 2, 3, 3] )
)
);
// Create the second data table
dt2 = New Table( "Untitled 10",
Add Rows( 2 ),
New Column( "Time",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [18, 19] )
),
New Column( "Tool",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [5, 8] )
)
);
// Join the 2 tables
dt3 = dt1 << Join(
With( dt2 ),
Merge Same Name Columns,
By Matching Columns( :Time = :Time ),
Drop multiples( 0, 0 ),
Include Nonmatches( 0, 0 ),
Preserve main table order( 1 )
);
