Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Ordering of subquery result

Re: Ordering of subquery result

From: Gene Hubert <ghubert_at_netpath.net>
Date: Sat, 06 Nov 1999 01:43:16 GMT
Message-ID: <74D562E3E6A26DCE.639107A8253E946F.ADD4359A6F99E000@lp.airnews.net>


>> In article <941739399.24425.0.pluto.d4ee154e_at_news.demon.nl>,
>> "Sybrand Bakker" <postmaster_at_sybrandb.nospam.demon.nl> wrote:
>> > Oracle is a RDBMS where R stands for relational. Relational database
>> theory
>> > is based on sets. A set is by design unordered. You can't expect a
>> subquery
>> > ever to provide ordered results. Hence the order by can be only
>> implemented
>> > in the main query.
>> > IMO this also means you can not expect the main query to return rows
>> in the
>> > order of the subquery, as there is no order.
>> > If you really want to return rows in the 'order' you specify, you
>> should
>> > take the queries apart and handle them by PL/SQL
>> >
>> > Hth,
>> >
>> > --
>> > Sybrand Bakker, Oracle DBA
>> > Brian Rasmusson <br_at_bellesystems.com> wrote in message
>> > news:3821B092.501310F3_at_bellesystems.com...

...

> > > but Oracle says ORA-00907: missing right parenthesis unless I
> delete the
> > > order by clause from the subquery. Actually, if I remove the order
> by
> > > clause, everything seems to be working the way I would like it to,

I've seen that same error about the missing right parenthesis; very helpful huh? There was a recent post by Thomas Kyte where he stated that ordering in a subquery is supported in Oracle 8.1.

Gene Hubert
SkillsPoint.com
http://www.skillspoint.com - Where smart people go to buy the right training! Received on Fri Nov 05 1999 - 19:43:16 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US