/build/static/layout/Breadcrumb_cap_w.png

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: 

SELECT

  MACHINE.NAME AS SYSTEM_NAME,

  SYSTEM_DESCRIPTION,

  MACHINE.IP,

  MACHINE.MAC,

  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.


0 Comments   [ + ] Show comments

Answers (2)

Posted by: rileyz 3 years ago
Red Belt
0

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.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ