Re: [sqlite] Using a select with 'where'

2012-05-01 Thread Simon
delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') The 'select personnick ...' can return zero, one, or many results, and I'd like to have the 'delete from ...' delete zero, one, or many rows from the addressbook table. How can I do that

Re: [sqlite] Using a select with 'where'

2012-05-01 Thread Black, Michael (IS)
Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Simon [turne...@gmail.com] Sent: Tuesday, May 01, 2012 2:08 PM To: General Discussion of SQLite Database Subject: EXT :Re: [sqlite] Using a select

[sqlite] Using a select with 'where'

2012-04-27 Thread Tim Streater
I'd like to delete multiple rows using the following syntax, but experiment appears to show that at most one row is deleted. I tried the following: delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') The 'select personnick ...' can return zero, one,

Re: [sqlite] Using a select with 'where'

2012-04-27 Thread Stephan Beal
On Fri, Apr 27, 2012 at 10:00 PM, Tim Streater t...@clothears.org.uk wrote: delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') i think what you want is IN instead of =. -- - stephan beal http://wanderinghorse.net/home/stephan/

Re: [sqlite] Using a select with 'where'

2012-04-27 Thread Tim Streater
On 27 Apr 2012 at 21:03, Stephan Beal sgb...@googlemail.com wrote: On Fri, Apr 27, 2012 at 10:00 PM, Tim Streater t...@clothears.org.uk wrote: delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') i think what you want is IN instead of =. Stephan,

Re: [sqlite] Using a select with 'where'

2012-04-27 Thread Simon Slavin
On 27 Apr 2012, at 9:00pm, Tim Streater t...@clothears.org.uk wrote: delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') The 'select personnick ...' can return zero, one, or many results, and I'd like to have the 'delete from ...' delete zero,

Re: [sqlite] Using a select with 'where'

2012-04-27 Thread Tim Streater
On 27 Apr 2012 at 22:16, Simon Slavin slav...@bigfraud.org wrote: On 27 Apr 2012, at 9:00pm, Tim Streater t...@clothears.org.uk wrote: delete from addressbook where absid=(select personnick from grouplinks where groupnick='27') The 'select personnick ...' can return zero, one, or many