A question about sql syntax
Hello, we have a user that is using Smart Labels for software deployment. The label will show any version lower than the one they're looking to deploy.
When a particular software reached version 10, they were no longer able to get a correct result because v. 68.8.0 doesn't appear as less than 68.10.0 because it appears to be comparing the 8 to the 1, rather than 10.
I'm afraid my sql knowledge is limited.
Does anyone perhaps know a way to get it to compare the 8 to 10 instead?
This is the example he sent to me:
MACHINE.NAME AS SYSTEM_NAME,
MACHINE.ID as TOPIC_ID
FROM MACHINE WHERE ( exists (select 1 from SOFTWARE, MACHINE_SOFTWARE_JT where MACHINE_SOFTWARE_JT.MACHINE_ID = MACHINE.ID AND SOFTWARE.ID = MACHINE_SOFTWARE_JT.SOFTWARE_ID
and SOFTWARE.PUBLISHER = 'Mozilla'
and SOFTWARE.DISPLAY_NAME like 'Mozilla Thunderbird%'
and SOFTWARE.DISPLAY_VERSION < '68.8.0'
Thanks so much.
Not that I am a SQL pro or anything, but we have that problem in PowerShell as well, because its trying to compare an decimal, and decimal only have a single point - not many like a version. In PowerShell we can 'cast' the type to version, in effect PowerShell can do the maths for us.
In SQL, I had a quick google and looks like you need to program it, eek.