Yes, and yes.  They're both documented in the manual.

http://www.mysql.com/doc/A/L/ALTER_TABLE.html
http://www.mysql.com/doc/I/N/INSERT.html
 
Steve Meyers


> -----Original Message-----
> From: Tony [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 25, 2001 12:57 PM
> To: [EMAIL PROTECTED]
> Subject: Column data type conversion Q
> 
> 
> Not sure if this post worked the first time (I never saw it come 
> in), so a 
> thousand pardons if this is a re-post.
> ----------------------------------------------------
> I come from the school of hard knocks, and so it seems my MySQL 
> indoctrination is no exception.  2 million rows of 'varchar' data 
> must be the 
> least efficient type to sort by.
> 
> I need to change a column data type from 'varchar(10)' to 'int' type.
> 
> I created another table, with the changed data type on the one column.  I 
> thought I read that nested selects were not supported by MySQL, but is it 
> possible to do something like this:
> 
>  insert into new_table values (select '__enter-some-sort-of-on-the-fly-
> data-type-conversion-on-a-column-or-two__' from old_table);
> 
> 
> Or, is there an ALTER TABLE command on the existing table.  Surely, this 
> would take a long time on a couple million rows.  I am running 
> MySQL 3.23.36 
> and RedHat 7.1 (2.4.3-12)
> 
> Kind regards,
> Tony
> 
> --botspeak:  sql, query, database
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail 
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to