Also:
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext BEFORE
ColumnNameToPutBefore
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext FIRST
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext LAST
will work, depending on what you're looking to do.
sk
--
MySQL
ALTER TABLE TableName MODIFY COLUMN ColumnNameToMove longtext AFTER
ColumnNameToPutAfter
Note that long text is required (put in the correct column type you
intend to move)
Alternate:
INSERT INTO new_table SELECT columns-in-new-order FROM old_table;
DROP table old_table;
ALTER TABLE new_table RE
Hi,
Is it possible to change the order of columns in a table after the table has
been created?
Thanks for your help
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi.
For what I know, MySQL always reads a whole row if it has to read the
row at all. So, no, column order should not matter at all.
With MyISAM tables, indexes are in a seperate file, build their own
way. So no, also no influence. I don't know enough about InnoDB to say
something for sure
Sorry, this came out ugly. I misinterpreted the list filter's
comments, and thought it would post my original message if I replied
to it, but instead it posted my reply including its warning.
Here's my original question, which is indeed about MySQL, although it
does not contain the words "SQL" o
References: <[EMAIL PROTECTED]>
From: Scott Gifford <[EMAIL PROTECTED]>
Date: 09 Apr 2002 15:40:38 -0400
In-Reply-To: [EMAIL PROTECTED]'s message of "Tue, 9 Apr 2002 21:28:35 +0200"
Message-ID: <[EMAIL PROTECTED]>
Lines: 33
User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
MIME-Version: 1.0
Content
At 04:26 PM 11/2/2001 -0600, Paul DuBois wrote:
>At 2:12 PM -0800 11/2/01, Bennett Haselton wrote:
>>How do you change the order of columns in MySQL tables? I assume the
>>tables have a concept of column order, since the DESCRIBE command always
>>lists the columsn in th
> How do you change the order of columns in MySQL tables? I assume the
> tables have a concept of column order, since the DESCRIBE command always
> lists the columsn in the order in which they were created.
http://www.bitbybit.dk/mysqlfaq/faq.html#ch7_5_0
/ Carsten
--
Carsten H.
in "C" so It's also in "C1". Next, alter the
table & remove column "C" and lastly rename column "C1" to "C".
bill;-)
-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 02, 2001 2:27 PM
To: Benne
At 2:12 PM -0800 11/2/01, Bennett Haselton wrote:
>How do you change the order of columns in MySQL tables? I assume
>the tables have a concept of column order, since the DESCRIBE
>command always lists the columsn in the order in which they were
>created.
>
>I figured that
How do you change the order of columns in MySQL tables? I assume the
tables have a concept of column order, since the DESCRIBE command always
lists the columsn in the order in which they were created.
I figured that the place to look would be the syntax page for the ALTER
TABLE statement
There are only 8,000 rows. Unfortunately, I was really hoping for some
sort of function within MySQL to do this. I'm not using PHP, but rather
Perl. I could pretty much do the same thing in Perl, I guess. Is there
any elegant solution or alternative within MySQL?
On Friday, July 20, 2001, a
How many rows do you have? I'd do it in php along those lines:
read the rows from the old table in 3 arrays. randomize one or
all of them (built in function in version 4, else do it
yourself), then populate new table from those arrays.
Sie schrieben am Freitag, 20. Juli 2001, 23:56:38:
> I'm sur
I'm sure I'm just missing something basic, but here goes...
I need to create a table, populated with data, from an existing table.
Easy enough:
"create table TEST select * from OLD_DATA"
Most cool. Now, let's say OLD_DATA has three columns: A, B, & C. I
want to create new table TEST, with a
14 matches
Mail list logo