Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread e-mail mgbg25171
; > COMMIT; > sqlite> select * from t1; > 1 > 2 > > > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of e-mail mgbg25171 > Sent: Wednesday, February 20, 2013 7:46 AM > To: General Discussion

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread Igor Tandetnik
On 2/20/2013 8:46 AM, e-mail mgbg25171 wrote: but how do I fill a table in a :memory: db with the contents of another in a real database? http://sqlite.org/lang_attach.html -- Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread Michael Black
...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of e-mail mgbg25171 Sent: Wednesday, February 20, 2013 6:46 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] got selected items ok but can't update using them Thanks Simon... Your's works a treat Re your question about

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread Igor Tandetnik
On 2/20/2013 7:45 AM, e-mail mgbg25171 wrote: Here's my query UPDATE stmnts SET itm=n where ID=i ( SELECT alias_id i, (SELECT orig_itm FROM stmnts where ID = alias_id) o, (SELECT itm FROM std_itms where ID = std_id) n FROM (SELECT std_id, alias_id FROM alias_itms) ) This doesn't even remotely

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread Igor Tandetnik
On 2/20/2013 6:36 AM, e-mail mgbg25171 wrote: SELECT i,o,n FROM ( SELECT alias_id i, (SELECT orig_itm FROM stmnts where ID = alias_id) o, (SELECT itm FROM std_itms where ID = std_id) n FROM (SELECT std_id, alias_id FROM alias_itms) ) This can be written simpler as select alias_id i, orig_itm

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread e-mail mgbg25171
Thanks Simon... Your's works a treat Re your question about my error Here's my query UPDATE stmnts SET itm=n where ID=i ( SELECT alias_id i, (SELECT orig_itm FROM stmnts where ID = alias_id) o, (SELECT itm FROM std_itms where ID = std_id) n FROM (SELECT std_id, alias_id FROM alias_itms) ) and

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread Simon Davies
On 20 February 2013 11:36, e-mail mgbg25171 wrote: > After a bit of a struggle I've got the fields I want but I'm failing to use > them in an update operation. > This > > SELECT i,o,n FROM > ( > SELECT alias_id i, > (SELECT orig_itm FROM stmnts where ID = alias_id) o,

[sqlite] got selected items ok but can't update using them

2013-02-20 Thread e-mail mgbg25171
After a bit of a struggle I've got the fields I want but I'm failing to use them in an update operation. This SELECT i,o,n FROM ( SELECT alias_id i, (SELECT orig_itm FROM stmnts where ID = alias_id) o, (SELECT itm FROM std_itms where ID = std_id) n FROM (SELECT std_id, alias_id FROM alias_itms) )