View Single Post

   
  #2 (permalink)  
Old 04-24-2008, 06:09 PM
Rik Wasmus
 
Posts: n/a
Default Re: How do I change a bad column name?

On Wed, 23 Apr 2008 21:36:27 +0200, <thelma@uwm.edu> wrote:

> I have a table one of whose columns is named 'interval', which is also
> a mysql datatype. I don't know how easy it is to create such a table,
> but it sure isn't easy to use it.
>
> Mysql won't let me access this column in any way that I've tried: I
> can't select it or update it; I can't delete it or rename it.
> Do I have to recreate the whole table to get rid of it?


Use backticks to access it:
ALTER tablename CHANGE COLUMN `interval` other_name <rest of column
definition>
--
Rik Wasmus
Reply With Quote