I have data like below. I need to compare the numbers in each field and rank the numbers by date and versions. I have tried explode and split but only the first field (10, 11, 10) are returning.
2018-07-01 10.1.1
2018-07-01 11.1.1
2018-08-02 10.0.5
I have data like below. I need to compare the numbers in each field and rank the numbers by date and versions. I have tried explode and split but only the first field (10, 11, 10) are returning.
2018-07-01 10.1.1
2018-07-01 11.1.1
2018-08-02 10.0.5
split(version,'\\.')
will return array of version numbers:
Major version number is split(version,'\\.')[0]
Minor version is split(version,'\\.')[1]
And the third number is split(version,'\\.')[2]
Use cast(string as int)
to convert them to int, like this: cast(split(version,'\\.')[0] as int)
Compare them one by one.