alter table medicine rename price to purchase_price ;
Asked
Active
Viewed 68 times
-6
-
what error do you get? – Vamsi Prabhala Dec 28 '15 at 19:41
-
[How do I ask a **good** question?](http://stackoverflow.com/help/how-to-ask) – marc_s Dec 28 '15 at 19:44
-
Have you at all tried looking into the documents or help file before posting a question. – Rahul Dec 28 '15 at 19:45
-
i dont ask any question but why ? i dont find answer for my question – Nina Dec 28 '15 at 19:54
-
Your question was closed because the problem was caused by a minor syntax issue that you could and should have solved yourself by reading the manual - in this case, the [Oracle SQL Reference Manual](http://docs.oracle.com/cd/B28359_01/server.111/b28286/toc.htm). Best of luck. – Bob Jarvis - Слава Україні Dec 28 '15 at 22:05
1 Answers
2
Syntax for rename
-ing a column is
ALTER TABLE table_name RENAME COLUMN old_name TO new_name;
You should use
alter table medicine rename column price to purchase_price

Vamsi Prabhala
- 48,685
- 4
- 36
- 58
-
If you want to answer a question then its better you edit the question so that its readable to others as well. Don't just jump onto the answers – Dec 28 '15 at 20:03
-
-
if you are so sure then why did you put the question on hold? I think it is not a good practice that you also put on hold and you also answer the question. – Dec 28 '15 at 20:12
-
it is better you do what you feel is right. easier to suggest i guess. – Vamsi Prabhala Dec 28 '15 at 20:13
-
Exactly I am doing what is better here. Nina is completely new to here. So nina has got to learn about how to ask questions here and without seniors like you not giving a suggestion will not be a easy journey. – Dec 28 '15 at 20:18