You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 21, 2025. It is now read-only.
selectcount(*) as count, length(ltrim(gtin, '0')) as gtin_x, length(gtin) as gtin
from products
group by length(ltrim(gtin, '0')), length(gtin)
order by length(ltrim(gtin, '0'));
returns:
count
gtin_x
gtin
1
0
1
1
1
14
1
3
3
1
4
5
1
4
14
7
5
14
3
6
8
76
6
14
1
7
8
1
7
14
6
8
8
9
8
13
163
8
14
143
9
13
3
9
14
1
10
10
1
10
11
777
10
13
14
10
14
3
11
11
14
11
12
325117
11
13
2474
11
14
34
12
12
267294
12
13
915
12
14
122288
13
13
2911
13
14
4
14
14
1
15
15
2
15
16
1
16
16
Clearly there is a lot of bad data in the production system (products with invalid GTNs). We need to figure out a plan for these records.
This query:
returns:
Clearly there is a lot of bad data in the production system (products with invalid GTNs). We need to figure out a plan for these records.