Jump to content

Moving a field up


Logician

Recommended Posts

I have a column called alphabet, with the fields B, A, C, D:

 

alphabet

--------

B

A

C

D

 

 

I am wanting to know how I can go about moving A up to where B is, so:

 

Alphabet

--------

A

B

C

D

 

There are other fields from other columns on this same line:

 

A | Active | Always

 

 

This procedure would be similar to:

ALTER TABLE (table) CHANGE COLUMN (column) (new column name) (type) AFTER (column);, but for a field instead of a column.

Link to comment
Share on other sites

In database terminology, there are rows and there are columns/fields. Columns and fields are the same thing and are interchangeable names that refer to the columns/fields that exist in a table. Think of rows going down the page and columns/fields going across the page.

 

Also, you don't alter your table structure to get your columns/fields or rows to be in a particular order, you do that in your query.

 

I'm guessing that your example actually refers to the value in different rows. To get a result set to be in any particular order, you would use an ORDER BY some_column term in your query.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.