MySQL statement for changing a column name with an illegal character

From: Aaron DuBois <aarond_at_berkeley.edu>
Date: Tue, 02 Oct 2007 11:39:55 -0700

OK a little bit ago we learned that "-" is an illegal character for
column names.
We found that in order to insert or change data in a column with such a
character we must put E-mail inside the ``. Thus `E-mail` is then
understood.

I want to clean up the mess here and change column names to be legal.
The statement:

Alter Table faculty Change `E-mail` email varchar;

is not working.
______________________________________________________________________
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html

" You can rename a column using a CHANGE old_col_name column_definition
  clause. To do so, specify the old and new column names and the type
that the column currently has. For example, to rename an INTEGER column
from a to b, you can do this:

ALTER TABLE t1 CHANGE a b INTEGER;"
______________________________________________________________________

I try it with all combos of "" and `` and caps/no caps, but to no avail.
I get:

"You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '' at line 1"

The info between the '' changes if i alter the statement shown above.
With "" and not `` :

"You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near '"E-mail"
email varchar' at line 1"

Any clues on how to alter the column name?
Feel free to call me dumb as long as you tell me how to alter the column
name too.

Thanks for any time on this,

-- 
Aaron DuBois
Sociology Tech
489 Barrows Hall
Mon-Fri 8:30am-12:30pm
510-643-9389
Department Web Master
Department IST Security Officer
Departmental Equipment Custodian
------------------------------------------------------------------------
The following was automatically added to this message by the list server:
To learn more about Micronet, including how to subscribe to
or unsubscribe from its mailing list and how to find out
about upcoming meetings, please visit the Micronet Web site:
http://micronet.berkeley.edu/
Messages you send to this mailing list are public and world-viewable,
and the list's archives can be browsed and searched on the Internet.
This means these messages can be viewed by (among others) your bosses,
prospective employers, and people who have known you in the past.
Received on Tue Oct 02 2007 - 12:01:35 PDT

This archive was generated by hypermail 2.2.0 : Tue Oct 02 2007 - 12:01:42 PDT