Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: PLSQL Collection Question
amerar_at_iwc.net wrote:
>
> Hi,
>
> I have 2 collections that are basically an array of numbers.
>
> I'm looking for some slick code that will compare collection #1
> against collection #2 and tell me how many elements of #1 are in #2.
>
> I can write some stupid FOR LOOP for WHILE LOOP with indexes and all,
> but I was wondering if anyone has something more slick or efficient?
>
> Thanks!
select ... from table(collection1)
minus
select ... from table(collection2)
or thereabouts...
-- Connor McDonald Co-author: "Mastering Oracle PL/SQL - Practical Solutions" Co-author: "Oracle Insight - Tales of the OakTable" web: http://www.oracledba.co.uk web: http://www.oaktable.net email: connor_mcdonald_at_yahoo.com "Semper in excremento, sole profundum qui variat." ------------------------------------------------------------Received on Wed Jun 20 2007 - 08:08:56 CDT