Reply to Re: ALTER column

Your name:

Reply:


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

Bob Stearns wrote:

> mick white wrote:

[snip]
>>

>> 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
>>
> You want UPDATE, a DML statement, not ALTER a DDL statement:
>
> UPDATE rhinos set `Date`=CONCAT(`Date`," 2006");
>
> But your longer term objective of changing field `date` to type 'date'
> is a much more difficult task. In general, you can not change the type
> of a column, so this will require an export, drop, create, import
> sequence. Further external date representations are of the form
> 'yyyy/mm/dd' or 'mm/dd/yyyy', depending on your RDBM and its settings;
> in particular, 'Mmm dd yyyy' is generally not allowed.

Thanks, Bob, that did the trick.
Mick

[Back to original 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

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