Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64451] Re: How to do a SQL type operation???
  • From: "Ray Koopman" <koopman at sfu.ca>
  • Date: Fri, 17 Feb 2006 04:12:20 -0500 (EST)
  • References: <dt1cu5$6a$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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