List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:January 29 2000 6:47pm
Subject:Re: Renaming table fields.
View as plain text  
At 5:46 PM +0000 2000-01-29, Thomas Barrett wrote:
>Hi,
>
>Having read through mysql.org docs and the mySQL book,
>I find no mention of this functionality (renaming fields).
>Is there a syntax for ALTER table that allows you to
>rename the fields in the table?
>
>Obviously as the naming was done right from the start,
>it was no problem to drop the field and insert a
>correctly named field in the right place. But I was
>wondering what the most efficient way of renaming
>fields would be if it were to be needed when the table
>already contained information.


Use ALTER TABLE tbl_name CHANGE col_name new_col_name col_definition

where col_definition is the definition that the column currently
has.  Yeah, it'd be nicer to be able to simply give the old and new
column name, but you can't do it that way.

-- 
Paul DuBois, paul@stripped
Thread
Question on Select using Perl..IMI)20 Jul
  • Re: Question on Select using Perl..Johan Isacsson20 Jul
  • Re: Question on Select using Perl..Paul DuBois20 Jul
    • Re: Question on Select using Perl..IMI)20 Jul
  • Renaming table fields.Thomas Barrett29 Jan
    • Re: Renaming table fields.Jeff Urban29 Jan
    • Re: Renaming table fields.Paul DuBois29 Jan