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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Select from table with array

Re: Select from table with array

From: FC <flavio_at_tin.it>
Date: Mon, 08 Apr 2002 20:16:42 GMT
Message-ID: <KUms8.74451$S52.2636142@news2.tin.it>


select meas_nr, pos_nr, (select wertlist(7) from table(select vallist from xvalues b

                                                        where b.meas_nr =
a.meas_nr
                                                          and b.pos_nr =
a.pos_nr)) from xvalues a
where meas_nr = 1
  and pos_nr = 4;

I am not sure whether it could be written in a shorter form, but perhaps yes

:-)

Cheers..

"Ivan Kaselj" <ikaselj_at_gmx.net> wrote in message news:4a4fb210.0204080153.4c1c7b8a_at_posting.google.com...
> Hello
> I have table defined like this:
>
> SQL> desc xvalues
>
> Name Null? Type
> --------------------------- -------- ----------
> MEAS_NR NOT NULL NUMBER(12)
> POS_NR NOT NULL NUMBER(7)
> SIGNUM VARCHAR2(8)
> VALLIST WERT_LIST
>
> SQL> desc WERT_LIST
> WERT_LIST VARRAY(200) OF NUMBER
>
> I have to select one row from the table with one value from VArray
> (not one row with all values from an array). And if possible, I dont
> want to do this in PL/SQL but in simple SQL statement.
> So lets say I want to select row where MEAS_NR = 1, POS_NR = 4 and
> from its corresponding array item 7.
>
> THNX
Received on Mon Apr 08 2002 - 15:16:42 CDT

Original text of this message

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