[sqlalchemy] What is the Sqlalchemy syntax for having ORDER BY and LIMIT on DELETE

2011-06-13 Thread Moshe C.
Hi, I am using Sqlalchemy 0.6.5 . How do I generate the following statement usin Sqlalchemy expressions (not ORM). DELETE FROM table ORDER BY timestamp LIMIT 10; TIA -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send

Re: [sqlalchemy] What is the Sqlalchemy syntax for having ORDER BY and LIMIT on DELETE

2011-06-13 Thread Michael Bayer
That's a MySQL specific syntax you might be better off not using, perhaps you could say delete from table where id in (select id from table order by timestamp limit 10). To get the exact statement, it's probably easiest just to emit the string SQL. If you wanted the sqlalchemy.sql.delete()