Discussion in 'SQL PL/SQL' started by Bagavathi, Dec 26, 2014.
Is it possible to retrieve first 100 prime numbers using SQL Query? If so kindly share the query.
select l prime_number
from (select level l from dual connect by level <= 100)
, (select level m from dual connect by level <= 100)
group by l
having count(case l/m when trunc(l/m) then 'Y' end) = 2
order by l