Title
#general
o

oneiroi

07/05/2022, 7:40 PM
Alright, this monstrosity; mostly works, any thoughts on potential gotacha's ?
WITH okVER as (SELECT '103.0.5060.114' as okVER) SELECT CAST(split(bundle_short_version, '.', 0) as INTEGER) as vA, CAST(split(bundle_short_version, '.', 1) as INTEGER) as vB, CAST(split(bundle_short_version, '.', 2) as INTEGER) as vC, CAST(split(bundle_short_version, '.', 3) as INTEGER) as vD, CAST(split(okVER, '.', 0) as INTEGER) as oA, CAST(split(okVER, '.', 1) as INTEGER) as oB, CAST(split(okVER, '.', 2) as INTEGER) as oC, CAST(split(okVER, '.', 3) as INTEGER) as oD FROM apps, okVER WHERE bundle_identifier = 'com.google.Chrome' AND (vA < oA) OR (vA = OA AND vB < oB) OR (vA = oA AND vB = oB AND vC < oC) OR (vA = oA AND vB = oB AND vC = oC AND vD < oD);
1. sets okVER to the acceptable value 2. splits the bunlde_short_version parts to vA->vD casting as integer 3. splits the okVER parts oA -> oD casting as integer 4. four conditions in the WHERE a. where bunlde_short_version major < okVER major b. bundle_short_version major == okVER major AND bundle_short_version minor < okVER minor c. bundle_short_version major == okVER major AND bundle_short_version minor == okVER minor AND bundle_short_version path < okVER patch d. bundle_short_version major == okVER major AND bundle_short_version minor == okVER minor AND bundle_short_version path == okVER patch AND bundle_short_version build < okVER build