Sorting Column names while viewing data in TOAD

Posted on 2007-10-04
Last Modified: 2013-12-12
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
Question by:cstraim
    LVL 142

    Accepted Solution

    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.
    LVL 8

    Expert Comment

    by:Bradley Haynes
    You may take a look at the Schema, however modifying this can break referential integrity rules.
    LVL 28

    Expert Comment

    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;

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
    This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now