473,398 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Cannot change column name.

I inadvertantly named a field "in"

mysql> select * from guestbook;
+----+-------+-------+-----------------+----------------+
| id | fname | lname | comments | in |
+----+-------+-------+-----------------+----------------+
| 1 | Mick | White | Test 123 | 20050208000000 |
| 2 | Ann | White | Hello World | 20050213101948 |
| 3 | | | It's a nice day | 20050213102405 |
+----+-------+-------+-----------------+----------------+
mysql> select in from guestbook;
ERROR 1064: 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 'in from guestbook' at line 1

But I can't seem to be able to change it:
mysql> alter guestbook change in time_in;
ERROR 1064: 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 'guestbook change in time_in' at line 1

The table:
mysql> desc guestbook;
+----------+-----------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------+----------------+
| id | int(4) unsigned | | PRI | NULL | auto_increment |
| fname | varchar(10) | | PRI | | |
| lname | varchar(10) | | | | |
| comments | text | | | | |
| in | timestamp(14) | YES | | NULL | |
+----------+-----------------+------+-----+---------+----------------+

Any takers?
Mick
Jul 23 '05 #1
2 2277
On Sun, 13 Feb 2005 18:56:29 GMT, in mailing.database.mysql Mick White
<mw***********@rochester.rr.com> wrote:
| I inadvertantly named a field "in"
|
| mysql> select * from guestbook;
| +----+-------+-------+-----------------+----------------+
| | id | fname | lname | comments | in |
| +----+-------+-------+-----------------+----------------+
| | 1 | Mick | White | Test 123 | 20050208000000 |
| | 2 | Ann | White | Hello World | 20050213101948 |
| | 3 | | | It's a nice day | 20050213102405 |
| +----+-------+-------+-----------------+----------------+
| mysql> select in from guestbook;
| ERROR 1064: 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 'in from guestbook' at line 1
|
| But I can't seem to be able to change it:
| mysql> alter guestbook change in time_in;
| ERROR 1064: 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 'guestbook change in time_in' at line 1
|
| The table:
| mysql> desc guestbook;
| +----------+-----------------+------+-----+---------+----------------+
| | Field | Type | Null | Key | Default | Extra |
| +----------+-----------------+------+-----+---------+----------------+
| | id | int(4) unsigned | | PRI | NULL | auto_increment |
| | fname | varchar(10) | | PRI | | |
| | lname | varchar(10) | | | | |
| | comments | text | | | | |
| | in | timestamp(14) | YES | | NULL | |
| +----------+-----------------+------+-----+---------+----------------+
|


ALTER TABLE `t2` CHANGE COLUMN `in` `time_in` TIMESTAMP(14);
---------------------------------------------------------------
jn******@yourpantsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #2
Jeff North wrote:


ALTER TABLE `t2` CHANGE COLUMN `in` `time_in` TIMESTAMP(14);

Thanks, Jeff, that did the trick.
Mick
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
3
by: Lori Markle via .NET 247 | last post by:
(Type your message here) Hi, I'm having a problem with binding a textbox to a dataset. Cananybody figure out what's going on here? I simply want to update a record. Type in a permit number...
6
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the...
6
by: ssailor | last post by:
Hi, everybody, I am rusty with VB. In the following code, ------------------------------------------------------ Dim dbCmd1 As OleDbCommand = New OleDbCommand("UPDATE tblLogin SET Password =...
3
by: kjqua | last post by:
Hi all, I am newbie in c# and i have a question regarding DataGridView I have a Table with 3 Columns (0)IdLeggiSeriale <Is Primary key> (1)ValoreSeriale <Is Integer>...
3
by: Coll | last post by:
I inherited a database. On one of the forms, a bunch of fields on the form are to be updated with data from a combo box containing many columns after one particular field is updated. I'm receiving...
2
by: bogie | last post by:
Hello I have some problem to change my column data type in my table property from character(15) to character(100). I use Postgresql 7.4. The problem is I try to make new column with...
5
by: captainphoenix | last post by:
visual basic 2005, this is my code: Dim frminterfacea As New frmInterface frminterfacea.Show() this loaded up the form frminterface until today. it worked fine yesterday, no change...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.