You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
An IN or NOT IN subquery whose only outer column is in JOIN ON or in a FROM function reuses the result of the first outer row #3143
alasql('CREATE TABLE t (a INT); INSERT INTO t VALUES (1),(2),(3)');alasql('CREATE TABLE u (x INT); INSERT INTO u VALUES (1),(2),(3)');alasql('CREATE TABLE v (k INT); INSERT INTO v VALUES (1),(2),(3)');alasql('SELECT COLUMN a FROM t WHERE a IN (SELECT u.x FROM u JOIN v ON v.k = u.x AND v.k = t.a)');alasql('SELECT COLUMN a FROM t WHERE 2 NOT IN (SELECT u.x FROM u JOIN v ON v.k = u.x AND v.k = t.a)');alasql('SELECT COLUMN a FROM t WHERE 2 IN (SELECT value FROM RANGE(1, t.a))');
It gives [1], [1, 2, 3] and [].
SQLite gives 1, 2, 3 and 1, 3, and 2, 3 for the last (with generate_series for RANGE).
Activity