Hi Tom, Please refer inline.
Thanks VENKATESWARAN Bug the Bugs On Fri, Jan 7, 2011 at 5:43 AM, BareFeetWare <list....@barefeetware.com> wrote: > On 06/01/2011, at 7:09 PM, stunner Easwar wrote: > > > I need to use local variables similar to sql syntax using DECLARE. My > project involves lot of places where I need to select values from different > tables and insert it into one table. In most of the cases creation of view > is also not feasible. Any alternative for DECLARE. > > Can you please give us example of your "places where I need to select > values from different tables and insert it into one table". > > This is sometimes called "re-injection", where you're extracting the > results of one query, only to re-inject it into another query. In SQL, this > is a very inefficient way to do it. Most situations like this can be better > handled by combining the select and insert into one SQL command. > Combining select and insert will be useful if i am inserting from same table. Will this work even with inserting three values when one is a constant (something like 12), other one is variable from one table and third one is variable from some other table. Any possible syntax for that? will the following thing work insert into <target table> (a,b,c) select 1,b from <table1> where <condition>, c from <table2> where <condition>; OR how i can make such a query to work > > Tom > BareFeetWare > > -- > Comparison of SQLite GUI tools: > http://www.barefeetware.com/sqlite/compare/?ml > > > > _______________________________________________ > 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