On Dec 15, 11:48 am, Doug Tykocki <[email protected]> wrote:
> Basically all I'm looking to do is to build a query like:
>
> SELECT *
> FROM [database1..table1]
> INNER JOIN [database2..table2] ON [database1..table1].key1 =
> [database2..table2].key2

At least the identifier quoting there looks wrong to me (but I'm not a
Microsoft SQL Server expert).

Anyway, this Sequel code:

  DB1[:database1__table1___t1].
    join(:database2__table2___t2, :key2=>:key1)

Gives this SQL:

  SELECT * FROM [database1].[table1] AS [t1]
  INNER JOIN [database2].[table2] AS [t2]
          ON ([t2].[key2] = [t1].[key1])

If that doesn't give you the exact answer you are looking for (like
you really need the .. instead of .), let me know.  It's possible to
handle the query you gave exactly, but I'm not sure that's really what
you want.

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