To rename a field, there are loads of examples and different syntax on the web, so I thought I would blog the only one that works for me:

ALTER TABLE <table_name>
    CHANGE COLUMN <field_name> <new_field_name>;

I think you have to specify the field type even if you aren’t changing it.

ALTER TABLE clients
    CHANGE COLUMN telephone telephonenumber
    VARCHAR(40) DEFAULT NULL;

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.