Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select from table with array
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
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