From: Dave P. <dpo...@te...> - 2003-08-01 00:19:51
|
How could one proceed to delete multiple records out of a database with a single query? I've been trying various methods but I seem to always end up with an "unhashable" error. desired query: DELETE * FROM accounts WHERE record_expiration <= NOW(); attempted SQLObject code: Accounts.delete( (Accounts.q.record_expiration <= func.NOW()) ) the only way I've been able to delete the records was true a rather more db intensive method: for account in Accounts.select( (Accounts.q.record_expiration <= func.NOW()) ): Accounts.delete( account.id ) Is there any better way to delete multiple rows? Thanks in advance, Dave. |