We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Print Prime Numbers
Print Prime Numbers
Sort by
recency
|
1328 Discussions
|
Please Login in order to post a comment
MS SQL Server:
SET @N = 1000;
WITH RECURSIVE numbers(n) AS ( SELECT 2 UNION ALL SELECT n + 1 FROM numbers WHERE n + 1 <= @N ), divisors as ( SELECT n, 2 as d FROM numbers WHERE n>2 UNION ALL SELECT n, d+1 FROM divisors WHERE d+1
select listAgg(num,'&') WITHIN GROUP (order by num) from (select distinct num,count(distinct e_R) over(partition by num) cnt from ( select num,num2, case when num=2 then 1 when num21)n1 cross join (select num2 from (SElect level as num2 from dual connect by level<=1000) where num2>1)n2 )order by num) where cnt=1;