I may be overlooking something obvious, however, I cannot discern from 
the documentation if this is possible.

given a simple example:

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

insert into x values (1);
insert into x values (2);
insert into y values (1, 'Hello world');

select case when
  (select y_value from y where y_id = x_id)
is null then
  'darn'
else
  (select y_value from y where y_id = x_id)
end
from x


Is there any way to eliminate the second (select y_value from y where 
y_id = x_id)?   If so, what would the query look like?


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