I want to get only year sysdate with my name of the defined column. but not able to get it.

I want to get only year sysdate with my name of the defined column. but not able to get it.

SQL > select to_char (sysdate, 'yyyy') as 'mahesh tyagi' from dual;

Mahé

----

2015

SQL > select to_char (sysdate, 'yy') as 'Manu' from dual;

my

--

15

So I couldn't do 'Manu' or "mahesh tyagi" as the column name.

The column name is "mahesh tyagi" is simply displayed it shortened to sqlplus due to the known values in the column length.

create table year_test select to_char (sysdate, 'yyyy') "mahesh tyagi" double;

year_test / / DESC

You can change the way sqlplus displays the header of column with something like

column "mahesh tyagi" format a15

Tags: Database

Similar Questions

Maybe you are looking for