Inner joins in DAL do not support AS. Can you show an SQL example of how you would use it?
Massimo On Apr 8, 10:08 pm, Paul Wray <[email protected]> wrote: > Hello > > I'm attempting a simple self join and having trouble with the aliases. > The slightly simplified query is: > > k1 = db.qkeyword.with_alias('k1') > k1 = db.qkeyword.with_alias('k2') > print db( (k1.keyword == 'this') > & (k2.keyword == 'that') > & (k1.question == k2.question) > & (k1.question == db.question.id))._select(db.question.ALL) > > The generated query looks correct except that k1 and k2 are > interpreted as existing table names, not aliases (ie no AS clause is > present). > > The only examples of aliases I have seen have used the left join, so I > suspect I need to somehow use it here too? > > Also, I'd love to read a more detailed description of the DAL if one > exists. The book provides examples, but does not contain sufficient > detail to give you a mental model of what is going on, and so > generalise from the examples. -- To unsubscribe, reply using "remove me" as the subject.

