You are viewing a single comment's thread. Return to all comments →
Oracle:
WITH odd_nums(n) AS ( SELECT 3 AS n FROM DUAL UNION ALL SELECT n + 2 FROM odd_nums WHERE n + 2 < 1000 ), odd_primes AS ( SELECT n FROM odd_nums numerator WHERE NOT EXISTS ( SELECT n FROM odd_nums denominator WHERE numerator.n != denominator.n AND MOD(numerator.n, denominator.n) = 0 AND denominator.n <= SQRT(numerator.n) ) ORDER BY n ), primes AS ( SELECT 2 AS n FROM DUAL UNION SELECT n FROM odd_primes ) SELECT LISTAGG(n,'&') WITHIN GROUP (ORDER BY n) FROM primes;
`
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 →
Oracle:
`