Thursday, 20 June 2019

1) How to extract 1-10 counting using Oracle SQL - 2) How to select data for more than 1000 using in clause

with dummy(id) as ( select 50 from dual union all select id + 1 from dummy where id < 60)  
select id from dummy
/

SELECT
   * 
FROM
   fnd_user 
WHERE
   (user_id,0) IN ((83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0),(83196,0)


DB2

with dummy(id) as ( select 55 from SYSIBM.SYSDUMMY1 union all select id + 1 from dummy where id < 60)  
select id from dummy

No comments:

Post a Comment