A clarification question...given the query:

create table x (x_id integer, f varchar);
create table y (y_id integer, x_id integer, f varchar);

insert into x values(1, 'wibble');
insert into y values(1, 1, 'foo');
insert into y values(1, 1, 'bar');

select y.y_id, case when y.f = 'foo' then 'very good' else (select x.f 
from x where x.x_id = y.x_id) end from y

The documentation states that:

"If the SELECT expression does contain variables from the outer query, 
then the SELECT is reevaluated every time it is needed."

Am I correct in assuming that if (using the above example) y.f = 'foo' 
that the sub-select is considered "not needed" and therefore is not 
executed?


John Elrick
Fenestra Technologies

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to