On Apr 6, 11:11 am, Drunkguy <[email protected]> wrote:
> I am trying to do a multiple table join, but I am having problems.  I
> am sure it is something
>
> Here is what I am trying to do:
> DB[:tickets].join(:solutions, :solution_code => :solution_code).join
> (:problems, :problem_code => :problem_code)

The most concise way to do this is probably:

DB[:tickets].join(:solutions, [:solution_code]).
  join(:problems, [:problem_code])

This will use a JOIN USING clause.  I'm not sure if Oracle supports
that, but it is standard SQL.  If it doesn't support JOIN USING:

DB[:tickets].join(:solutions, :solution_code => :solution_code).join
(:problems, :problem_code => :tickets__problem_code)

You only need to explicitly qualify the column that would be
implicitly qualified incorrectly.

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