February 7th, 2000, 04:11 PM
Whats the easiest way to change the order of fields in a table structure?
February 8th, 2000, 07:01 AM
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'.
February 9th, 2000, 04:34 AM
<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>
drop table orig_table;
create table new_ordered_table
select b,c,a from table_copy ;