This is a discussion on How do I change a bad column name? within the MySQL Database forums, part of the Database Forums category; I have a table one of whose columns is named 'interval', which is also a mysql datatype. I don't ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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? thanks, --thelma |
|
|||
|
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 |
|
|||
|
On Wed, 23 Apr 2008 14:36:27 -0500, 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? > > thanks, --thelma Quote it with back-tickies, like `interval` and think every time how annoying it is, and resolve never to permit this kind of foolishness to happen in the future. -- 12. One of my advisors will be an average five-year-old child. Any flaws in my plan that he is able to spot will be corrected before implementation. --Peter Anspach's list of things to do as an Evil Overlord |
|
|||
|
Peter H. Coffin <hellsop@ninehells.com> wrote:
: On Wed, 23 Apr 2008 14:36:27 -0500, 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? : > : > thanks, --thelma : Quote it with back-tickies, like `interval` and think every time how : annoying it is, and resolve never to permit this kind of foolishness to : happen in the future. Thank you, and thanks also to Rik Wasmus. I didn't create the table; I just inherited it, but it's kept me from adding columns called 'limits' and 'done', names too close to things the database might someday want for itself --thelma |