> havent pored through any of these, but keep in mind you dont need > to use the query building feature at all. you can send your own > full- blown SQL if you have a better idea of what query should be > used for a particular case (using either query.instances() or by > sending a full select() construct to query.select()). heh, i don't have a vague idea what it should be. i see at web that what i'm describing is called self-join. So basicaly, self-referential/self-joining queries cannot be done in SA? worse, it can be more than 2 level, e.g. give those persons which persons.friend.friend.friend.name == 'pipi'
> On Feb 15, 9:41 am, svilen <[EMAIL PROTECTED]> wrote: > > and, how u make the (3) or (4) work? > > aliasing the table.column in the comparison does not help.. it > > should be aliased somehow inside the join also.. > > > > Here a simpler case, without the inheritance. > > 3 and 4 do not work here too - one does exception, other return > > nothing. > > > > maybe express the query in another way? how? > > > > ciao > > svil > > > > > taking a look, i think what you should do is use an alias of > > > the table_Employee in your queries. since the engineer mapper > > > is using joined table inheritance, the default table_Employee > > > is already going to be involved in the query, so your external > > > join condition needs to be off a distinct alias of it to > > > prevent mixups. > > > > query-self-ref.py > > 2KDownload > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---