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: Need help with one query--ASAP

Re: Need help with one query--ASAP

From: Viktor Wiens <viktorww_at_arcor.de>
Date: Fri, 30 Nov 2007 09:22:38 +0100
Message-ID: <474fc848$0$27120$9b4e6d93@newsspool1.arcor-online.net>


Hallo,

Sandy80 schrieb:
> Hi,
>
> I have a query in which I have a value that is repeated a number of
> times in the where clause. If I use the 'in' clause it returns only 1
> value no matte how many no. of times the value is repeated. For eg.
>
> select legacy_emp_no from Table 1
> where
> emp_no in
> (1234,
> 1234,
> 1234,
> 2345,
> 2345)
>
> Now what this query returns is one row per emp_no i.e.
> 456
> 789
>
> What I want the query to return is:
> 456
> 456
> 456
> 789
> 789
>
> I mean I want the return value to be repeated the same no. of times it
> is repeated in the 'in' clause.
> Please help ASAP.
>
> Regards,
> Sandy

try

CREATE TYPE number_list as table of number; SELECT *
   FROM TABLE (number_list (7369, 7369, 7499)) a

      , scott.emp b
   WHERE a.COLUMN_VALUE = b.empno;

Viktor Wiens Received on Fri Nov 30 2007 - 02:22:38 CST

Original text of this message

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