EDIT2: Actually not. It turns out to be a bug in the way Adobe is treating any integer PK column, no matter how it is defined, INT, or INTEGER, as an alias for the rowid in SQlite. This is incorrect. rowid does not always equal the PK value. This causes joins to return the wrong values.
EDIT: turns out to be the use of the absolute value function in the query.
My bread-and-butter query, the one that is the core of my application, uses a UNION query with inline views when doing proximity word-searches. It works beautifully in SQLite returning a resultset in about one second from an over 300MB database, against several tables equijoined, the two biggest tables having close to 4 million rows and 300,000 rows, respectively.
It runs fine in Visual Studio using the .NET provider for SQLite, and also in SQLite Manager 0.5.6 by Mrinal Kant and in other front-ends to SQLite. But the verbatim query returns no rows in Flex and zero rows in the SQLite Admin GUI front-end, which is built on the Flex SQL libraries.
My first thought is that inline views might not be supported in Flex?
Does Flex do what in the Microsoft world is called a "pass-through" query, sending the sql intact through to the back end, or does Flex take the query statement apart and apply the WHERE clause conditions client-side, as Microsoft Access does to support so-called "heterogeneous" joins, i.e. queries that might join tables from, say, SQL Server and Oracle in the same query?