We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

How do I change the order of fields when I edit a table? base

asked 2015-11-18 04:15:31 +0200

dlnewhouse gravatar image

updated 2016-03-14 00:21:32 +0200

Alex Kemp gravatar image

I am trying to move a field from the end of my table to somewhere in the middle. How do I do this?

edit retag flag offensive close merge delete


I used to be able to do this after clicking Edit on the table's context menu. Then I would cut and paste the field I wanted to move to first place. And then the one I wanted in second place. And so forth. Then I'd save the table. Exit the edit window. And save the file.

Now when I do that, the changes do not take effect.

I have no idea why. It's weird and it's frustrating.

(And, no, I haven't changed any settings or upgraded the software. I'm using LO on Win7.)

markroth gravatar imagemarkroth ( 2018-09-11 21:14:23 +0200 )edit

3 Answers

Sort by » oldest newest most voted

answered 2016-03-15 23:41:13 +0200

Ratslinger gravatar image

SQL. I don't know of a way to do this within Base easily. I typically use SQL Workbench or MySQL Workbench depending on what database I'm using. If the DB is empty, it is fairly simple. Take the SQL source displayed, re-arrange (cut & paste) what you want, Drop the old & create the new. If, however, you have data in the DB, it can be tedious. Create a new table with what you want then with SQL, copy the data from one table to another field by field. As a side note, there is no logical reason that fields have any sequence within a database.

edit flag offensive delete link more


Confirmed on LO, you can try to drag-drop the columns but the cursor changed to the You can't do this one, and doesn't matter how you drag or drop. However, I checked the HSQLDB 1.8.0 syntax and it confirms you can change the order through SQL: http://www.hsqldb.org/doc/guide/ch09.html#alter_table-section. Although I can understand the reason for lack of such feature to be harder to figure out which column was moved where, it's not impossible, just keep copies of the column names.

rautamiekka gravatar imagerautamiekka ( 2016-03-16 00:07:57 +0200 )edit

I also want to note that it is as easy as drag & drop to move columns using MySQL Workbench.

Ratslinger gravatar imageRatslinger ( 2016-03-16 13:00:54 +0200 )edit

answered 2019-12-07 17:13:26 +0200

Even easier. Drag the database table into a blank calc sheet, move columns as required and save as original file name. Open Base with the database table and the columns have been changed. Do backup first though.

edit flag offensive delete link more

answered 2019-02-15 23:11:41 +0200

lucky67 gravatar image

I came across this (old) question trying to do the same thing. Not as professional but I found a work around that I found easier than using SQL. (Although I guess I should look at MySQL Workbench....)
Probably easier/safer If you haven't got lots of data in your table and I would make sure I had a backup first and know the 'field type' /settings of each field.

I 'imported' (dragged the table into) a blank calc sheet. Added a new column and the new field name I wanted. Deleted the table in Base, went back to Calc and exported (dragged back) the table to Base. Gave it the same name, used the column headings as field names etc. I did have to go through and reset the field type of each field. I might have to edit a couple of queries and a form.... but quicker than having to make a new table, typing in 15 field names etc.

I guess I should say that I had no data in the table - I was using a copy of a pre-existing database as a template and needed to add and change a couple of field names in one table. And also I import and export tables between Base and Calc quite often - I get data sent to me as an Excel file (don't have a choice about it) that I want to add to a database.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-11-18 04:15:31 +0200

Seen: 3,160 times

Last updated: Dec 07 '19