[Tutor] sqlite3 does it support limit in a delete clause?

eryksun eryksun at gmail.com
Fri Feb 22 06:10:52 CET 2013


On Thu, Feb 21, 2013 at 8:47 PM, Jim Byrnes <jf_byrnes at comcast.net> wrote:
>
>>>> cur.execute("delete from pwds where Account='xMe' limit 1")

If you need a alternate way to limit the delete, try the following,
for which the limit is on a select query:

    cur.execute('''
      delete from pwds where rowid in (
        select rowid from pwds where Account='xMe' limit 1)
    ''')


More information about the Tutor mailing list