#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2000
    Posts
    10
    Rep Power
    0
    Whats the easiest way to change the order of fields in a table structure?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 1999
    Location
    Bombay,Maharastra,India
    Posts
    8
    Rep Power
    0
    There isn't AFAIK. But if you're doing 'SELECT * FROM table_name' and you want the
    order changed, then you can 'SELECT' the column names in the order you want ie.
    'SELECT second_field,first_field FROM table_name'.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Posts
    14
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by gjs:
    Whats the easiest way to change the order of fields in a table structure?[/quote]

    One way is to copy the table to something else then re-create it with the columns in right order, e.g. you have a table with three columns a,b and c:

    create table table_copy
    select * from orig_table;

    <you now have a copy of orig_table in table_copy>

    Then:

    drop table orig_table;

    and finally:

    create table new_ordered_table
    select b,c,a from table_copy ;


Similar Threads

  1. League table problem
    By silverduck in forum MySQL Help
    Replies: 8
    Last Post: February 10th, 2004, 01:38 PM
  2. how to keep table on top, not centered??
    By vinyl in forum HTML Programming
    Replies: 2
    Last Post: January 20th, 2004, 07:19 PM
  3. Changing format for the table in JSP
    By whosehere in forum Java Help
    Replies: 1
    Last Post: September 29th, 2003, 06:31 PM
  4. Disabling or changing expanding table cells
    By db_rufus in forum HTML Programming
    Replies: 0
    Last Post: September 18th, 2003, 10:55 AM
  5. Uknow Known MYSQLERROR
    By andyw in forum MySQL Help
    Replies: 7
    Last Post: January 23rd, 2001, 10:34 AM

IMN logo majestic logo threadwatch logo seochat tools logo