If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
I was wondering if there was a way to easily order the fields of a table that display from a "SHOW COLUMNS FROM table_name".
I assumed this might be possible with an "ALTER TABLE table_name MODIFY ..." command but I haven't been able to get anything to work. I noticed there is syntax for "ALTER TABLE MODIFY" that could prove useful (FIRST | BEFORE | AFTER) but on all my attempts I couldn't get anything to work.
I know I could go around all this by just dumping my table and re-creating it with the field orders I intended but I figured MySQL had an easier way I could do this with a few simple commands.
you need the int (or char or char(15) or whatever) for the columntype after the first column so the database knows what type of data is stored in the column.
What version of mysql are you using? I can't think that it should matter but I think 1064 errors crop up when you are using a version of mysql that isn't compatible with the code you are attempting (such as using a subquery before 4.1 or whatever version it starts with). Rudy or Pat can you clarify if I am right with this line of thinking?