Is there some absolute requirement that it all be done in SQL?  Depending on 
the number of "items", it'd probably be faster in a loop in code. 

Even in MSSQL Server using TSQL, you're better off using a cursor for that sort 
of thing. I only use UPDATE FROM when I need a join to formulate the WHERE 
clause. 

> On Jun 4, 2016, at 12:18, skywind mailing lists <[email protected]> 
> wrote:
> 
> Hi,
> 
> why? At the moment I have to run something like:
> 
> UPDATE A SET item1=(SELECT B.item FROM B WHERE B.ID=A.ID),... itemN=... WHERE 
> EXISTS (SELECT 1 FROM B WHERE B.ID=A.ID);
> 
> Using a FROM clause I just need one scan through B (at least in principle). 
> Now, I need N+1 scans.
> 
> Regards,
> Hartwig
> 
>> Am 2016-06-04 um 15:33 schrieb Gerry Snyder <[email protected]>:
>> 
>> If SQLite implemented the FROM it would just be a translation into the
>> complex and slow statements you want to avoid.
>> 
>> Gerry Snyder
>> On Jun 4, 2016 9:19 AM, "skywind mailing lists" <[email protected]>
>> wrote:
>> 
>>> Hi,
>>> 
>>> I am using quite often SQL statements that update the data of one table
>>> with data from another table. This leads to some quite complex (and slow)
>>> statements because SQLite3 is not supporting a FROM clause in update
>>> statements. I am just wondering why the FROM clause is not supported by
>>> SQLite3?! Is this too complex to implement or is there simply no demand for
>>> these type of statements?
>>> 
>>> Regards,
>>> Hartwig
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> sqlite-users mailing list
>>> [email protected]
>>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> 
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to