You are viewing a single comment's thread. Return to all comments →
WITH RECURSIVE numbers AS ( SELECT 2 AS num UNION ALL SELECT num + 1 FROM numbers WHERE num < 1000 ), prime_numbers AS ( SELECT num FROM numbers n WHERE NOT EXISTS ( SELECT 1 FROM numbers n2 WHERE n2.num < n.num AND n.num % n2.num = 0 ) ) SELECT GROUP_CONCAT(num SEPARATOR '&') AS prime_numbers FROM prime_numbers;``
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 →