Results 1 to 4 of 4

Thread: MYSQL: Changing Column Name

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    MYSQL: Changing Column Name

    Hi,

    How do you change a column's name in MYSQL?

    thanx

  2. #2

    Re:MYSQL: Changing Column Name

    ALTER TABLE table_name CHANGE old_col_name create_definition

    create_definition is just like when you use CREATE .

    example: col1 INT or col2 VARCHAR(20)

  3. #3
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    Re:MYSQL: Changing Column Name

    Where do you specify the NEW_name

    if I have a db called 'testdb' and a table called 'testtable' with 'testcolumn' of def var(20)

    ALTER TABLE testtable CHANGE testcolumn var(20);

    I want to change the name to new_column. where?

    thanx

  4. #4
    Advisor
    Join Date
    Apr 2002
    Posts
    858

    Re:MYSQL: Changing Column Name

    http://www.mysql.com/documentation/m...ter/index.html aoughta have all the info you need.

Similar Threads

  1. MySQL worm for Windows halted
    By genesis in forum Windows - General Topics
    Replies: 0
    Last Post: 01-28-2005, 09:53 PM
  2. Hopefully quick q on MySQL
    By Schotty in forum Linux - Software, Applications & Programming
    Replies: 9
    Last Post: 02-25-2003, 12:16 PM
  3. MySQL Error msgs
    By gmoreno in forum Announcements and Suggestions
    Replies: 4
    Last Post: 01-31-2003, 09:01 PM
  4. MySQL Admin GUI
    By mcdougrs in forum Linux - Hardware, Networking & Security
    Replies: 5
    Last Post: 10-25-2002, 08:45 PM
  5. mysql installation instructions & permissions
    By elovkoff in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 02-06-2002, 10:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •