Correct.


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Simon Slavin
Sent: Tuesday, February 14, 2017 11:08 AM
To: SQLite mailing list
Subject: Re: [sqlite] bug: fields from external (being updated) table cannot be 
used in "order by" clause of a subselect


On 14 Feb 2017, at 3:55pm, David Raymond <david.raym...@tomtom.com> wrote:

> It's not. It sets up an alias to a new view of test. In the where clause the 
> i.whereField is referring to that new view of the whole table, whereas the 
> test.whereField is referring to the field in the current record of test 
> that's being updated.

Is it a self-JOIN then ?  A select where you do something like

SELECT products.id,betterProduct.id FROM products
        JOIN products AS betterProduct ON betterProduct.purpose = 
product.purpose
        WHERE betterProduct.score > product.score

?

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to