You are here: ALTER column « PHP SQL « IT news, forums, messages
ALTER column

Posted by mick white on 09/30/92 11:37

I have a table `rhinos`
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| Day | varchar(20) | YES | | NULL | |
| Date | varchar(20) | YES | | NULL | |
| AwayTeam | varchar(30) | YES | | NULL | |
| HomeTeam | varchar(30) | YES | | NULL | |
| Time | varchar(20) | YES | | NULL | |
| Venue | varchar(40) | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+

I want to add " 2006" to the `Date` field;

mysql> SELECT Day,Date from rhinos limit 2;
+----------+--------+
| Day | Date |
+----------+--------+
| Friday | Apr 21 |
| Saturday | Apr 22 |
+----------+--------+
2 rows in set (0.00 sec)
mysql> ALTER TABLE rhinos set `Date`=CONCAT(`Date`," 2006");
I've tried variations of this, to no avail.

My ultimate goal is to convert the field to a real date type.
Any pointers?
Mick

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация