Subject Prime numbers
Author Roberto Carlos
The example below is from PostgreSQL. Is there an easy way to do it in Firebird 2.5 or 3.0?
 
I need prime numbers to analyse bio data:
 
with primes (num) as (
  select generate_series(2,10000)
)
SELECT num
FROM primes p1
WHERE num not in (
    SELECT p1.num
    FROM primes p2
    WHERE p2.num < p1.num
    AND MOD(p1.num, p2.num) = 0
);