Gerhard Haering wrote:
On Thu, Nov 11, 2004 at 09:40:44AM -0500, [EMAIL PROTECTED] wrote:I'm not the original poster.. but I'm trying to come up to speed on SQL/sqlite and I'm having some trouble understanding this... What is an example of a static subquery? And how would one re-write this to eliminate the subquery?
[...] The following SQL does not work, complaint is "Error: no such column: B.GROUP_ID"
select ID, (select SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
from B [...]
Looks like you haven't read this resource, yet:
http://sqlite.org/omitted.html
It mentions, among others: Variable subqueries Subqueries must be static. They are evaluated only once. They may not, therefore, refer to variables in the main query.
-Alan