MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to do a SQL type operation???


Richard Palmer wrote:
> Thanks Ray and others.  I was also able to do solve the problem with a
> dispatch command.  Figured it out after I sent the note.

Would that be something like

In[1]:= table1 = {{a,Xa},{b,Xb},{c,Xc},{d,Xd},{a,Xaa},{c,Xcc}};
        table2 = {{a,Ya},{b,Yb},{c,Yc},{d,Yd}};
        table1 /. Dispatch[({#[[1]],x_}->{#[[1]],x,#[[2]]})&/@table2]

Out[3]= {{a,Xa,Ya},{b,Xb,Yb},{c,Xc,Yc},{d,Xd,Yd},
         {a,Xaa,Ya},{c,Xcc,Yc}}


  • Prev by Date: Re: Re: Mathematica:recursion with 2 arguments?
  • Next by Date: Re: How to plot this
  • Previous by thread: Re: Re: How to do a SQL type operation???
  • Next by thread: Mathematica 5.2 for Linux X Error