From: Ken Bloom Date: 2008-01-21T07:09:58+09:00 Subject: Re: [ANN] SqlStatement 2.0 -- Generate complex SQL statements programmatically On Sun, 20 Jan 2008 11:40:31 -0600, Ken Bloom wrote: > sqlstatement - Generate complex SQL statements programmatically > =============================================================== I forgot to mention that the documentation is online at http://sqlstatement.rubyforge.org/ > Example > ======= > If we wanted to generate SQL code similar to > > SELECT `value1`,`value2` > FROM `jointable`,`dictionary1`,`dictionary2` WHERE > `jointable`.`id1`=`dictionary1`.`id` AND > `jointable`.`id2`=`dictionary2`.`id` The examples actually generate slightly more verbose SQL code, using INNER JOIN instead of a comma to indicate a join. (This is to avoid precedence issues when performing LEFT JOINs). --Ken -- Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/