• + 0 comments

    WITH RECURSIVE primes as ( Select 2 as n union all select n+1 from primes where n+1<=1000 -- termination statement )

    select group_concat(n SEPARATOR '&') from primes x where n not in ( select a from ( Select n1.n as a,n2.n as b from primes n1 inner join primes n2 on n2.n