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
https://forums.phpfreaks.com/topic/250861-moving-a-field-up/
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
https://forums.phpfreaks.com/topic/250861-moving-a-field-up/#findComment-1287041
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.