how to delete the particular column [message #189504] |
Thu, 24 August 2006 22:51  |
youthsen
Messages: 45 Registered: August 2006
|
Member |
|
|
hi pals
i have 5 columns such as
SQL> desc stu;
Name Null? Type
------------------------------- -------- ----
RNO NUMBER
M1 NUMBER
M2 NUMBER
M3 NUMBER
TOT NUMBER
i have inserted the data's in all the columns. now i want to delete a particular column. how to do this.
|
|
|
|
|
Re: how to delete the particular column [message #189577 is a reply to message #189504] |
Fri, 25 August 2006 02:59   |
youthsen
Messages: 45 Registered: August 2006
|
Member |
|
|
hi srinivas.dd
it is not working
SQL> alter table stu drop column tot;
alter table stu drop column tot
*
ERROR at line 1:
ORA-00905: missing keyword
SQL> alter table stu drop_column tot;
alter table stu drop_column tot
*
ERROR at line 1:
ORA-01735: invalid ALTER TABLE option
i am using personal oracel 8.0 for win95.
how to solve this problem.
|
|
|
Re: how to delete the particular column [message #189596 is a reply to message #189577] |
Fri, 25 August 2006 03:31   |
pamrajrajeev
Messages: 9 Registered: July 2006
|
Junior Member |
|
|
Hai,
I Think it will work only from oracle 9i onwards. Just check it out.
to drop a particular column,
alter table <tablename> drop column <columnname>;
to drop list of columns,
alter table <tablename> drop columnanme1,columnnane2,....;
note: column keyword is not used
regards
Rajeev
|
|
|
|
|
Re: how to delete the particular column [message #324092 is a reply to message #189571] |
Fri, 30 May 2008 15:11   |
renu4dwh
Messages: 24 Registered: April 2008 Location: Pune
|
Junior Member |
|
|
JRowbottom wrote on Fri, 25 August 2006 02:48 | Or, if you just want to remove the data, and not the column
UPDATE stu SET m2 = null;
|
yeah i found your post useful. This this is what i was asked in an interview
|
|
|
Re: how to delete the particular column [message #324095 is a reply to message #324092] |
Fri, 30 May 2008 15:27  |
 |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Who ask question about version 8.0? Surely a fool.
Maarten, RENAME already existed in version 7 for sure, I don't clearly remember before but I think it was already there in version 5.
Regards
Michel
|
|
|