-- { echoOn } SELECT number, ip, ip % number FROM (SELECT number, toIPv4('1.2.3.4') as ip FROM numbers(10, 20)); 10 1.2.3.4 0 11 1.2.3.4 3 12 1.2.3.4 4 13 1.2.3.4 12 14 1.2.3.4 0 15 1.2.3.4 10 16 1.2.3.4 4 17 1.2.3.4 10 18 1.2.3.4 4 19 1.2.3.4 10 20 1.2.3.4 0 21 1.2.3.4 7 22 1.2.3.4 14 23 1.2.3.4 12 24 1.2.3.4 4 25 1.2.3.4 10 26 1.2.3.4 12 27 1.2.3.4 13 28 1.2.3.4 0 29 1.2.3.4 1 SELECT number, ip, number % ip FROM (SELECT number, toIPv4OrNull('0.0.0.3') as ip FROM numbers(10, 20)); 10 0.0.0.3 1 11 0.0.0.3 2 12 0.0.0.3 0 13 0.0.0.3 1 14 0.0.0.3 2 15 0.0.0.3 0 16 0.0.0.3 1 17 0.0.0.3 2 18 0.0.0.3 0 19 0.0.0.3 1 20 0.0.0.3 2 21 0.0.0.3 0 22 0.0.0.3 1 23 0.0.0.3 2 24 0.0.0.3 0 25 0.0.0.3 1 26 0.0.0.3 2 27 0.0.0.3 0 28 0.0.0.3 1 29 0.0.0.3 2