Cenny Active Member Licensed User Longtime User May 11, 2015 #1 I am looking for a sql statement that gives me records where the fieldnames are in alphabetical order Cenny
I am looking for a sql statement that gives me records where the fieldnames are in alphabetical order Cenny
DonManfred Expert Licensed User Longtime User May 11, 2015 #2 select fieldA,fieldB,[...] FROM table; Dont use *. Add all Fields by it names and aplabetical order into the query.... There is no buildin function to get the fields ordered. Upvote 0
select fieldA,fieldB,[...] FROM table; Dont use *. Add all Fields by it names and aplabetical order into the query.... There is no buildin function to get the fields ordered.
eurojam Well-Known Member Licensed User Longtime User May 11, 2015 #4 I don't think, that you can manage it in one step. First you have to query the fieldnames from your table. There are different sql statements in the different database systems for that, like in sqlite: Code: Copy PRAGMA table_info(mytable); in the second step you iterate through the result of the first query and build your select statement Upvote 0
I don't think, that you can manage it in one step. First you have to query the fieldnames from your table. There are different sql statements in the different database systems for that, like in sqlite: Code: Copy PRAGMA table_info(mytable); in the second step you iterate through the result of the first query and build your select statement
Cenny Active Member Licensed User Longtime User May 11, 2015 #5 I have solved it by extracting the fieldnames from the table, put them in a list, sorted it and used the list to build a new sql select statement. Works fine. Thanks for your suggestions. Cenny Upvote 0
I have solved it by extracting the fieldnames from the table, put them in a list, sorted it and used the list to build a new sql select statement. Works fine. Thanks for your suggestions. Cenny