Re: [SQLObject] Multiple join with the same table
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ian B. <ia...@co...> - 2004-04-22 15:55:38
|
Oleg Broytmann wrote: > Hi! > > How can I rewrite a complex join like this (simplified): > > SELECT * FROM table1 a, table2 b, table2 c WHERE b.parent = c.id... > > using SQLBuilder? How can I include a table twice? Unfortunately, no, there's no way to alias tables with SQLBuilder. (Patches accepted!) Well, I think you could do it by generating the SQL through SQLBuilder directly (instead of the magic .q variables), so as to get other tables, and then adding clauseTables=['table1 a', 'table2 b']. But I'm not sure about that. Ian |