|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Whats the easiest way to change the order of fields in a table structure?
|
|
#2
|
|||
|
|||
|
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'. |
|
#3
|
|||
|
|||
|
<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 ; |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Changing order of fields in a table? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|