Xref: alice comp.databases.oracle.server:65837 comp.databases.oracle.tools:31884
Path: alice!news-feed.fnsi.net!newsfeed.eurocyber.net!newsfeed.mathworks.com!howland.erols.net!peerfeed.news.psi.net!nntp.psi.com!is-news.gwl.com!not-for-mail
From: Prasad Pelala <ppel@gwl.com>
Newsgroups: comp.databases.oracle.server,comp.databases.oracle.tools
Subject: Re: Order by non-base table item in Forms 4.5
Date: Tue, 14 Sep 1999 16:10:56 -0600
Organization: Rapidigm, Inc.
Lines: 21
Message-ID: <37DEC7F0.C9F7C4AF@gwl.com>
References: <37DE4A4E.801CE125@scpa.sri.com>
Reply-To: no_auto_reply
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: is-news.gwl.com 937347056 4993 143.199.56.140 (14 Sep 1999 22:10:56 GMT)
X-Complaints-To: usenet@is-news.gwl.com
NNTP-Posting-Date: 14 Sep 1999 22:10:56 GMT
X-Mailer: Mozilla 4.5 [en] (X11; U; SunOS 5.6 sun4u)
X-Accept-Language: en

It depends on when you calculate the "calculated field".

If your calculated field is based on the values from the 
base table items, you can use DECODE in the order by
as ORDER BY decode(user_entered_paramter, 'A', ((item1*item2)/100),
                                          'B', ((item2/item2)*100) ....

Prasad.


Scott Haas wrote:
> 
> Is there a way to order by a non-base table item ?   This non-table item
> is calculated based on criteria that a user enters prior to querying the
> database.  I want to be able to order the records based on this
> calculated field.  Would I have to put the retrieved records with the
> calculated field into a temporary table and then perform the order by or
> is there a more simple way to solve this ?
> 
> TIA,
> Scott
