Hmmm, sure, I undersrand well the concept of joins, But I have in my time seen plenty of useful clever devices. I will forward the snippet in the documentation that I have misunderstood later since I'm currently on a nyc subway train.
In the meanwhile back to this issue given the join You have provided can I do this dataset.where account__colx: :acct_docs__coly -Charles On Jan 30, 2013 7:11 PM, "Jeremy Evans" <[email protected]> wrote: > On Wednesday, January 30, 2013 2:50:57 PM UTC-8, Charles Monteiro wrote: >> >> so I have this: >> >> >> table1 = database[:account] >> table2 = database[:acct_docs] >> >> dataset = table1.where account_nbr: :acct_docs__account_nbr >> >> I get the following error: >> >> SELECT * FROM "ACCOUNT" WHERE ("ACCOUNT_NBR" = "ACCT_DOCS"."ACCOUNT_NBR") >> >> Sequel::DatabaseError: Java::JavaSql::**SQLSyntaxErrorException: >> ORA-00904: "ACCT_DOCS"."ACCOUNT_NBR": invalid identifier >> >> I'm guessing it wants to see: "ACCT_DOCS.ACCOUNT_NBR" >> >> am I correct ? >> > > No. This is unrelated to the quoting of the identifiers. > > >> if so bug ? >> > > Well, a bug in your code. You aren't adding the ACCT_DOCS table to the > query. Whenever you have a query that involves multiple tables, you need > to join them in some way (either explicitly via JOIN or implicitly via > multiple FROM tables). You probably want something like: > > dataset = database[:account].join(:acct_docs, account_nbr: :account_nbr) > > If this is at all confusing, you should probably consult a general SQL > reference. > > Thanks, > Jeremy > > -- > You received this message because you are subscribed to the Google Groups > "sequel-talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sequel-talk?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
