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
|