[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1796
  • Last Modified:

Sorting Column names while viewing data in TOAD

I have a dataset with over 256 columns (probably like 500).  I would like to be able to sort the colmn names in alphabetical order when looking at the data view.

Can Sql order the column names AND show the data contained within the columns?  

Note:  Im not trying to sort the data itself, just the column or "field" names

I'm using Toad
1 Solution
Guy Hengel [angelIII / a3]Billing EngineerCommented:
sql itself cannot do that.
however, you could "generate" your query with a query:

select column_name from all_tables
where table_name = 'yourtablename'
order by column_name

and use that output to build your query with the columns alphabetically.

there is nothing automatic...
you might consider to create a view on the table, if you want to "view" the data like that often.
Bradley HaynesCommented:
You may take a look at the Schema, however modifying this can break referential integrity rules.
Naveen KumarProduction Manager / Application Support ManagerCommented:
go to schema browser, click on the table u want to view and then click on columns tab where it shows all the columns present in that table, ( by default i think columns are ordered by column id but not sure ) - so just click on the column_name header in the columns tab to sort the column names in ascending or descending order and then do a multi select and copy all the column names and paste it in the below.

<<paste it here>> -- remove the last comma after the last column name,
                               -- the column names will be in   order of column names as u wanted
from your_table;

Forced accept.

EE Admin

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now