あるテーブルの行のデータを調べて、それらが別のテーブルの列にあるかどうかを確認します。最初の表

2番目の表

1番目のテーブルの4行目の最大値を2番目のテーブルの隣接する列と比較してみます。
これまでのところ、最初のテーブルから列名と行の値を抽出しました。
dt1 = Open();
namesForCols = dt1 << get column names("String");
show(namesForCols);
row4 = dt1[4, 0];
show(row4);
close(dt1,nosave);リストrow4の値が2番目のテーブルの列に存在するかどうかをどうやって確認できますか?ありがとう。
再:1つのテーブルの行のデータをチェックして、それらが別のテーブルの列にあるかどうかを確認するこれはあなたの質問に答える簡単なスクリプトです。
Names Default To Here( 1 );
dt1 = Data Table( "Table 1" );
dt2 = Data Table( "Table 2" );
// Get the numeric columns
colNamesList = dt1 << get column names( numeric, string );
// Add a new row of data, that will tell how many rows in
// Table 2 have the maximumn values from row 4
dt1 << add rows( 1 );
dt1:Column 1[N Rows( dt1 )] = "Number of Rows Found";
// Loop across the numeric columns in table 1
For( i = 1, i <= N Items( colNamesList ), i++,
// If the column in table 2 exists, process
If( Try( Column( dt2, colNamesList[i] ) << get name, "" ) != "",
// Get the value from table 1 to compare with in table 2
compareValue = Column( dt1, colNamesList[i] )[4];
// Find the number of rows in table 2 that match the
// value in row 4 of table 1 and save it into row 5
// of table 1
Column( dt1, ColNamesList[i] )[N Rows( dt1 )] =
N Rows(
dt2 << get rows where(
As Column( dt2, colNamesList[i] ) == compareValue
)
);
)
);