[Solved] reordering of fields in a table??

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

[Solved] reordering of fields in a table??

Post by waskelton4 »

is it possible to reorder the fields in a table?

i have some tables that have no logical order to how the fields are displayed and it makes browsing them a little more difficult..

can it be done?

ws
Last edited by waskelton4 on Fri Oct 21, 2005 4:37 pm, edited 1 time in total.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The entities in a database table are unordered per definition...

Offcourse, you can use the ORDER BY clause to order the entities returned from a query...
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

Post by waskelton4 »

actually,

not 5 minutes before your reply posted.. i found a "re-order columns" command in the SQLyog Enterprise edition GUI i've been trying out.

It worked like a charm.
not only did it reorder the columns when i few the table in it.. but also in mysqlCC

havne't tried to "show tables" at command line.. maybe tomorrow..

Thanks for the reply..

Will
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Must admit that i didn't read your question well.. So i confused fields/columns with records/rows.

http://dev.mysql.com/doc/refman/5.0/en/ ... order.html
waskelton4
Forum Contributor
Posts: 132
Joined: Mon Sep 09, 2002 6:42 pm

[SOLVED] - reordering of fields in a table??

Post by waskelton4 »

thanks for the link..

I guess it actually has to re-write the whole table according to the documentation..

the first user comment down there shows another way that looks better.. wonder if it works.. :)

Thanks again

Will
Post Reply