Igor, Michael
Thank you very much for your advice re how to use Update with compound
queries

I'm currently trying to copy the rows of stmnts with a blank itm field to a
temporary table.
I don't think virtual tables are implemented in my programming language's
interface and so wanted to
copy the stmnts table from the real database where itm='' to a table in a
:memory: database.
I appreciate that the statement is normally
insert into tbl values (fld1 integer, fld2 text);
but how do I fill a table in a :memory: db with the contents of another in
a real database?
I'll keep looking into it.



On 20 February 2013 13:17, Michael Black <mdblac...@yahoo.com> wrote:

> You need the selects in each = expression to replace the variables there.
> Something like this if I translated your query correctly.
>
> UPDATE stmnts SET itm=(SELECT itm FROM std_itms where ID = std_id) where
> ID=(SELECT alias_id from alias_itms);
>
> -----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 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 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)
> )
>
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to