I don't see how that helps. Let's say I have table with rules which
determine from which view to select:

create rules_table
(condition integer, myview integer);

insert into rules_table values (1,10);
insert into rules_table values (2,20);
insert into rules_table values (3,30);
insert into rules_table values (4,40);

I would use this query to determine which view to use:

select myview
from rules_table
where condition = :condition_in;

Let's just use a very basic (and meaningless) example here:
select * from
(select myview
  from rules_table
  where condition = :condition_in)

Something like this will generate an error, same if I try to use case.


On Wed, May 11, 2011 at 11:13 PM, Igor Tandetnik <itandet...@mvps.org>wrote:

> John <tauru...@gmail.com> wrote:
> > So now I know that case can return column names. But is there a way to
> tell
> > it from which table to select.
> > Earlier I assumed that it is not possible. But know I requestioning
> > everything.
> > This, at least, has not worked:
> >
> > create table t1 (col integer);
> > create table t2 (col integer);
> >
> > select * from
> > (select case
> >  when 1=1
> >  then t1
> >  else t2
> > end);
>
> select * from t1 where 1=1
> union all
> select * from t2 where not (1 = 1);
>
> --
> Igor Tandetnik
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



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

Reply via email to