Re: Order By in Nested Tables
From: ExecMan <artmerar_at_yahoo.com>
Date: Wed, 2 Nov 2011 13:01:29 -0700 (PDT)
Message-ID: <ea8ba203-acc1-4c5f-b229-8eb30010b7f2_at_g1g2000vbd.googlegroups.com>
On Nov 2, 12:12 pm, joel garry <joel-ga..._at_home.com> wrote:
> On Nov 2, 6:48 am, ExecMan <artme..._at_yahoo.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > Our application has a complex query. The query retrieves data from a
> > table, which contains some nested tables. I'm being asked if the
> > results of the nested tables can themselves be sorted. So, the query
> > is something like this:
>
> > SELECT .........
> > FROM stock_info s, TABLE(estimate_trends) s1,
> > TABLE(financial_overview) s2
> > WHERE ticker = 'IBM';
>
> > They want the results for the nested tables to themselves be sorted by
> > their first column, which is a sequence number.
>
> > Can this be done via normal SQL?
>
> SQL is relational, nested tables are object-relational extensions to
> oracle. So, I don't know.
>
> Seehttp://technology.amis.nl/blog/1217/sorting-plsql-collections-the-qui...
> (found by googling oracle sort results from nested table) and don't be
> put off by the subject of that post, check out how the sort is done.
>
> jg
> --
> _at_home.com is bogus.
> "ORA-01536 space quote exceeded for tablespace string" - 11.2 docs
Date: Wed, 2 Nov 2011 13:01:29 -0700 (PDT)
Message-ID: <ea8ba203-acc1-4c5f-b229-8eb30010b7f2_at_g1g2000vbd.googlegroups.com>
On Nov 2, 12:12 pm, joel garry <joel-ga..._at_home.com> wrote:
> On Nov 2, 6:48 am, ExecMan <artme..._at_yahoo.com> wrote:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > Our application has a complex query. The query retrieves data from a
> > table, which contains some nested tables. I'm being asked if the
> > results of the nested tables can themselves be sorted. So, the query
> > is something like this:
>
> > SELECT .........
> > FROM stock_info s, TABLE(estimate_trends) s1,
> > TABLE(financial_overview) s2
> > WHERE ticker = 'IBM';
>
> > They want the results for the nested tables to themselves be sorted by
> > their first column, which is a sequence number.
>
> > Can this be done via normal SQL?
>
> SQL is relational, nested tables are object-relational extensions to
> oracle. So, I don't know.
>
> Seehttp://technology.amis.nl/blog/1217/sorting-plsql-collections-the-qui...
> (found by googling oracle sort results from nested table) and don't be
> put off by the subject of that post, check out how the sort is done.
>
> jg
> --
> _at_home.com is bogus.
> "ORA-01536 space quote exceeded for tablespace string" - 11.2 docs
That is a good article. I'm not 100% sure it is what I want, as I have several nested tables, and the application wants each one sorted be it's first column, the sequence #. I think this is a good starting point though. Received on Wed Nov 02 2011 - 15:01:29 CDT