Ivorde Unix/Linux/Database/Web/Mail Forum

View unanswered posts
View active topics
It is currently Sat Feb 04, 2012 10:26 pm


Mysql Application & Query Optimization, Questions, Indexes, Bugs.

Bookmark this article:

Author Message
admin
  Post  Post subject: Mysql - Change position of a column after another column  |  Posted: Fri Aug 20, 2010 12:03 pm
Site Admin

Joined: Mon Aug 03, 2009 3:43 pm
Posts: 25

Offline
Save on Delicious
The column order in mysql is not very important in most of the cases, since the SELECT statement can create another column order, one specifically for the application being developed (but not the "SELECT *" statement).

But in cases where order is important, this command will change the position of "column_two" after "column_one".

Code:
mysql> ALTER TABLE table_name MODIFY column_two INT(11) UNSIGNED AFTER column_one;


Top
sonee4
Post  Post subject: Re: Mysql - Change position of a column after another column  |  Posted: Fri Oct 08, 2010 8:41 am

Joined: Fri Oct 08, 2010 6:25 am
Posts: 3

Offline
Thanks for suggesting this great and important code and post.


Top
Display posts from previous:  Sort by  
Print view

Topics related to - "Mysql - Change position of a column after another column"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Mysql change column's default value

debuser

0

1469

Thu Aug 12, 2010 10:43 am

debuser View the latest post

There are no new unread posts for this topic. Mysql: add column to table

debuser

1

2741

Fri Oct 08, 2010 8:38 am

sonee4 View the latest post

There are no new unread posts for this topic. Mysql add Unique index to a table column

debuser

0

412

Fri Aug 06, 2010 5:01 pm

debuser View the latest post

There are no new unread posts for this topic. Mysql remove column from an existing table

debuser

0

314

Fri Aug 06, 2010 5:06 pm

debuser View the latest post

There are no new unread posts for this topic. Mysql> select records that have date/datetime column equal to today's date

admin

0

148

Tue Nov 22, 2011 4:40 pm

admin View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
News News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC + 2 hours [ DST ]

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
DAJ Glass 2 template created by Dustin Baccetti

phpBB SEO