-6

alter table medicine rename price to purchase_price ;

Nina
  • 1

1 Answers1

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
  • i am not sure what your problem is, in reading the question? – Vamsi Prabhala Dec 28 '15 at 20:08
  • 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