You are viewing a single comment's thread. Return to all comments →
with cte_r as( select 2 as n union all select n+1 from cte_r where n < 1000 ), check_prime as( select a.n from cte_r a left join cte_r b on b.n >= 2 and b.n <= sqrt(a.n) and a.n % b.n = 0 where b.n is null ) SELECT STRING_AGG(n, '&') WITHIN GROUP (ORDER BY n) FROM check_prime OPTION (MAXRECURSION 1000);
Seems like cookies are disabled on this browser, please enable them to open this website
Print Prime Numbers
You are viewing a single comment's thread. Return to all comments →