Re: For SQL-Freaks: Column-Renaming in Oracle-SQL (version 7)

From: Dave Mausner <dma956_at_lulu.acns.nwu.edu>
Date: 1995/11/21
Message-ID: <48t2ug$7sl_at_news.acns.nwu.edu>#1/1


In article <48q7ae$bqr_at_news.rz.uni-passau.de>, Klaus Berndl <berndl_at_urolph.uni-passau.de> wrote:
>To my knowledge, the following standart-sql-instruction (renaming of column-
>names) is correct:
>
>SELECT R.c0, R.c2
>FROM supplies R(c0, c1, c2)
>WHERE R.c1 > 12.00;
>
>The problem is now, ORACLE 'SqlPlus' (Version 7) doesn`t agree with me relating
>to correctness of the statement above!

which standard does this statement conform to? there is no easy general solution to the problem you have posed. more generally, relational tables do not have either a column "order" nor a row "order", so talking about the "first" column is actually not playing by the rules.

in oracle you can query the view USER_TAB_COLUMNS, and by selecting a column name using table_name and column_id=number, you can generate a query that selects columns by their original declaration order. this is a lot of work but it may help you accomplish whatever weird thing you are trying to do. Received on Tue Nov 21 1995 - 00:00:00 CET

Original text of this message