OK, will remember that. Still, in this particular case it seems odd as there is only one column and one table in the sub-select. Learned something there.
RBS On Sun, Mar 22, 2015 at 3:03 PM, Igor Tandetnik <igor at tandetnik.org> wrote: > On 3/22/2015 10:48 AM, Bart Smissaert wrote: > >> But I thought that as the non-aliased column emis_number is in the >> sub-select (select emis_number from DIABETICS) >> that column name could only apply to the table DIABETICS and there should >> be no ambiguity. >> > > A subselect can happily use columns from the containing statement. Read > about a "correlated subquery" in your favorite SQL textbook. > > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users >