Hi,
How can I reference a table that I am deleting from in an inner/nested
statement?
Here is my simplified oritinal version, no inner condition:
rownum = sql.expression.over(sql.func.row_number(),
partition_by=table.c.some_id,
why don’t you use a NOT EXISTS correlated subquery? that way the subquery can
refer to the outer table completely, rather than having just one column where
you can call IN.
On Dec 3, 2014, at 12:36 PM, Stefan Urbanek stefan.urba...@gmail.com wrote:
Hi,
How can I reference a table that
Thanks,
I used exists (reversed condition):
condition = primary.c.rownum != 1
unique = sql.expression.exists([1],
whereclause=condition)
delete = sql.expression.delete(table,
whereclause=unique)
I'm still getting: