Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can Table Transformer treat numbers in a column as text when trying to filter or sort?

Alan Lambert
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2024

I have a table that contains software version numbers e.g. 1.0, 2.1, 3.1.1

As you can see, sometimes the data can be interpreted as a number (2.1), and sometimes it can't (3.1.1).

When filtering the SQL using this column I am getting no rows being returned and when sorting by this column version numbers are getting mixed up. I assume that the data is being interpreted as a number. I've tried explicitly converting to a string, but I'm still not getting data back.

e.g.

SELECT T1.'Feature' FROM T1
WHERE T1.'Version' = '1.0'

or

SELECT T1.'Feature' FROM T1
WHERE (T1.'Version'::string) = '1.0'

1 answer

1 accepted

3 votes
Answer accepted
Stiltsoft support
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 1, 2024

Hi @Alan Lambert ,

You may try the following option:

SELECT * FROM T1
WHERE TEXT('Version') = "1.0"

Please note that we use 'Column_name' but "Some_value". The quotes differ in the AlaSQL library on which the macro is built.

Alan Lambert
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 1, 2024

Thank you

Like # people like this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events