Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Create View
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:
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
![]() |
![]() |