The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

3 votes
Answer accepted
Stiltsoft support
Atlassian Partner
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
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events