Consider the following sqlite> create table t1(a int, b int, c int); sqlite> create table t2(a int, b int); sqlite> insert into t1 values (1, 2, 3); sqlite> insert into t2 values (3, 4); sqlite> select a,(select b, c from t2 where t2.a=t1.a)=(3,3) from t1; 1|
In the embedded select it takes c from the outer table t1 but doesn’t flag ‘ambiguous column’ for b in the embedded select. Is it standard that tables at the same level are searched first for the column and tables from the surrounding levels are only searched if it’s not found? If so, is this also the case if selects are embedded to several depths. E.g. depth 3 tables searched first, then depth 2 and finally lowest depth? Apologies if that’s not worded correctly. Scottish education could be done gooder 😊 _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users