oracle11g - how to add column and how to which data type will be use -


s_no    s_name       s_father ------------------------------- 1       ram          mohan 2       hareesh      galla 3       praveen      nagaraj 4       mallikarju   bandaru 5       yashas       penubakam 

now want add dob column existing table. how can dob column added existing table , data type should used?

here example

sql> create table t1 (id number);  table created.  sql> insert t1 values (1);  1 row created.  sql> commit;  commit complete.  sql> select * t1;          id ----------          1  sql> alter table t1 add update_date date;  table altered.  sql> desc t1  name             null?    type  ------------------------ --------    id                        number  update_date               date  sql> update t1 set update_date = to_date('01/01/2013','dd/mm/yyyy');  1 row updated.  sql> commit;  commit complete.  sql> select * t1;          id update_date ---------- -------------------          1 01/01/2013 00:00:00  sql> select id , update_date , to_char(update_date , 'dd-mon-yyyy') formated_update_date t1;          id update_date         formated_up ---------- ------------------- -----------          1 01/01/2013 00:00:00 01-jan-2013 

i suggest going on documentation


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -