clear markdown compare help best fiddles feedback dbanow.uk
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2591627 fiddles created (45700 in the last week).

DECLARE @prefix INT; SET @prefix = 573071; WITH cte1 AS (SELECT 0 num UNION ALL SELECT num+1 FROM cte1 WHERE num < 9) SELECT num, @prefix*100+num*10+9-((@prefix/100000+(@prefix/1000)%10+(@prefix/10)%10+num)*3+((@prefix/10000)%10+(@prefix/100)%10+@prefix%10)-1)%10 barcode FROM cte1;
num barcode
0 57307107
1 57307114
2 57307121
3 57307138
4 57307145
5 57307152
6 57307169
7 57307176
8 57307183
9 57307190
 hidden batch(es)