Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Wed May 24, 2017 1:11 pm


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

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

Joined: Mon Aug 03, 2009 8:43 am
Posts: 94

Offline
 

Mysql - Change position of a column after another column

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;

_________________
VPSie - SSD VPS servers in AMS-IX, LINX, DE-CIX
https://vpsie.com





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

Joined: Thu Oct 07, 2010 11:25 pm
Posts: 3

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


Top
Display posts from previous:  Sort by  
E-mail friendPrint 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

995

Thu Aug 12, 2010 3:43 am

debuser View the latest post

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

debuser

1

1578

Fri Oct 08, 2010 1: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

1119

Fri Aug 06, 2010 10:01 am

debuser View the latest post

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

debuser

0

609

Fri Aug 06, 2010 10:06 am

debuser View the latest post

There are no new unread posts for this topic. How to calculate mysql time difference between unix timestamp column and now() format

mandrei99

0

4049

Fri May 31, 2013 4:10 am

mandrei99 View the latest post

There are no new unread posts for this topic. Mysql change root password

mandrei99

0

890

Tue Feb 10, 2015 6:50 pm

mandrei99 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

1642

Tue Nov 22, 2011 9:40 am

admin View the latest post

There are no new unread posts for this topic. MySql doesn't start: libexec/mysqld: File './mysql-bin.index' not found (Errcode: 13)

debuser

0

1020

Mon Feb 22, 2010 1:43 pm

debuser View the latest post

There are no new unread posts for this topic. Rename MySql table

debuser

1

481

Fri Oct 08, 2010 1:36 am

sonee4 View the latest post

There are no new unread posts for this topic. MySql rename table

admin

2

773

Mon Nov 28, 2011 3:39 am

Darwin View the latest post

 

Who is online
Users browsing this forum: No registered users and 1 guest
You can post new topics in this forum
You can 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 - 5 hours [ DST ]



phpBB SEO