Question: Maple equivalent of R merge or RDBMS join.

I have two lists in Maple that I would like to join into a single list based on the values in a common field.  The best tool for such an operation is a relational database management system (RDBMS) where I would use SQL JOIN syntax.  The R program for statistics has an internal command, "merge" which can perform this operation on data frames [http://stat.ethz.ch/R-manual/R-patched/library/base/html/merge.html].  I would like an analogous operation in Maple as a convenient alternative to turning to a full RDBMS.  Does Maple offer such a command?

I attempted to implement a naive loop to achieve this however it does not take advantage of indices and therefore takes far too long to run:

i := 1;

for c in C do
pos := ListTools:-Search(C[i, 1], M[1 .. -1, 1]);

DocumentTools:-SetProperty(Meter0, 'value', 100*i/Crows, 'refresh' = true);

if pos > 0
then
N[i] := ListTools:-Flatten([M[pos], C[i, 2], C[i, 3]])
else
N[i] := [C[i, 1], null, null, null]
end if;

i := i+1
end do

 

Please Wait...