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

Home -> Community -> Usenet -> c.d.o.server -> Re: Create View

Re: Create View

From: <fitzjarrell_at_cox.net>
Date: Thu, 16 Aug 2007 07:41:18 -0700
Message-ID: <1187275278.043967.205660@w3g2000hsg.googlegroups.com>


On Aug 16, 8:48 am, learning_co..._at_hotmail.com wrote:
> Hi,
>
> I am learning and would need your help.
>
> I'm able to create a simple SQL in the oracle view.
>
> Select Home
> AS
> HOME FROM CITYDATABASE
> WHERE HOME = 'Single'
> /
>
> I want to know if there is a possilbe way to add extra column called
> "YEAR" like Format([Month_END],"YYYY" into above script.
>
> Your help would be much appreciated.
> Thanks

Yes, and it's quite similar to what you typed:

select home, to_char(month_end, 'YYYY') year from citydatabase
where home = 'Simple';

I don't understand why you alias a column with the same name as the current column name so I didn't do that in my query. And the AS keyword is optional. Note the use of the to_char() function; you can look this up at:

http://tahiti.oracle.com

by selecting the release of Oracle you're using and then searching for 'to_char';

David Fitzjarrell Received on Thu Aug 16 2007 - 09:41:18 CDT

Original text of this message

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