Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Is it possible for me to create such a view?

Re: Is it possible for me to create such a view?

From: Philippe <parnaud_at_yahoo.com>
Date: Tue, 6 Apr 1999 14:26:31 +0200
Message-ID: <7ecujq$88l$1@concorde.ctp.com>


With the decode function :

view1:

select z1_c1, decode(z1_c2<100,'TRUE','FALSE') from z1

view2:

select z1.z1_c1, decode(z2.z2_c1,null,'FALSE','TRUE') from z1, z2 where z2.z2_c1(+) = z1.z1_c1

HTH,
Philippe

Johnson Chao wrote in message <7echbm$f8k$1_at_nnrp1.dejanews.com>...
>Hi:
> I am just beginnin to learn sql and oracle.
> I am now having two tables:
> 1. create table z1(z1_c1 number,z1_c2 number)
> 2. create table z2(z2_c1 number)
>
> In z1:
> 1 90
> 2 150
> 3 200
>
> In z2:
> 2
> 7
> 8
> 9
>
> I am now trying to create a view from z1 whose second column's value is
>decided by some conditions. 1. create a view z1_view1 whose second
column's
>value is TRUE if z1's second column's valuse is less then 100, else FALSE.
>In my case, the out put should be: z1_view1: 1 TRUE 2 FALSE 3 FALSE
>
>
> 2. create a view z1_view2 whose second column's value is TRUE if z1's
first
>column's value exists in z2, else FALSE. In my case, the output should be:
1
> FALSE 2 TRUE 3 FALSE
>
>How can I do that? Any help will be greatly appreciated.
>
>
>Johnson Chao
>ctc Japan
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Apr 06 1999 - 07:26:31 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US