Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need help with one query--ASAP
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
![]() |
![]() |