Apart from the need to explicitly qualify is there any disadvantage
with doing it like this?

DB[:table1].join(:table2, {:table2__colA => :table1__colA} &
(:table2__colB < :x))

Just like how you would write it in a filter.

On Apr 15, 2:31 pm, Jeremy Evans <[email protected]> wrote:
> On Apr 15, 12:23 pm, Duc Qui <[email protected]> wrote:
>
> > I am trying to join two tables on multiple columns. Is there any way
> > to express the following in Sequel without resorting to literals?
>
> > select...
> > from table1
> > join table2
> > on (table1.colA = table2.colA and table2.colB < x)
>
> DB[:table1].join(:table2, :colA=>:colA){|j,lj,js| :colB.qualify(j)
> < :x}
>
> Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to