Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: views...
Hi,
try this:
select col1,col2,col3,1 from tab1 where <your condition>
union all
select col1,col2,col3,0 from tab1 where <your reverse
condition>;
or explore the amazing power of decode, like
select col1,col2,col3, decode(col4,'Y',1,'N',0) from tab1,tab2 where <join condition of tab1,tab2>;
Decode is useful only if you have few distinct values of col4 in tab2, like Y and N in this exapmple.
rgds