I am a novice at Firebird SQL. Can anyone advise how I specify the order of field name in Firebird? If I change the name of the header, then it places that field at the end. In another situation the field names appear differently in Excel that they do in the preview. (Can't see any particular pattern, not even aphabetical or alphabetical per table). Any hints are appreciated.
-
Exactly what are you doing; if you care about order, then you usually change the order of columns in your select query, not the order of columns in the physical table. – Mark Rotteveel Oct 20 '16 at 12:44
2 Answers
I understand your question as you want to change the fields order in a table, permanently.
For that, Firebird FAQ gives this DDL-statement:
ALTER TABLE table_name ALTER field_name POSITION new_position;
Positions are numbered from one. If you wish to exchange two fields, make sure you run the statement for both of them.
If you want to change the fields order temporary, e.g. in a query, you can obviously just define the fields order in the select statement. But I think, this is one of the first things a SQL novice learns.

- 2,766
- 2
- 20
- 43
By SQL
ALTER TABLE TABLE_NAME ALTER COLUMN FIELD_NAME POSITION x;
See ALTER TABLE — Changing the Position of a Column: the POSITION Keyword
Far as I know, there is no option to automatically arrange the fields. But you may use your preferred tools like FlameRobin, IBExpert etc. to do this manually. They have this functionality.
For example FlameRobin:

- 100,966
- 191
- 140
- 197

- 2,705
- 17
- 22