SunQuest
           MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 7th, 2000, 04:11 PM
gjs gjs is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2000
Posts: 10 gjs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Whats the easiest way to change the order of fields in a table structure?

Reply With Quote
  #2  
Old February 8th, 2000, 07:01 AM
chyrag chyrag is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 1999
Location: Bombay,Maharastra,India
Posts: 8 chyrag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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'.

Reply With Quote
  #3  
Old February 9th, 2000, 04:34 AM
trellick trellick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Posts: 14 trellick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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 ;



Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Changing order of fields in a table?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway