• + 0 comments

    i've not yet learnt cte can someone help with a basic sql code. i wrote this but it incorrect

    SELECT GROUP_CONCAT(num SEPARATOR '&') AS primes FROM ( SELECT n.num FROM numbers n WHERE n.num <= 100 AND n.num > 1 AND NOT EXISTS ( SELECT 1 FROM numbers d WHERE d.num > 1 AND d.num < n.num AND n.num % d.num = 0 ) ) AS prime_list;