I have a column called price and all the values are TEXT so like this: “$26.71”.
I want to sort this column in descending order but i can’t because the column is not defined as INTEGER and it has a “$” character in front of all the values.
What should i do in order to make this work??
Thanks.
I have a column called price and all the values are TEXT so like
Share
You can combine
ltrimandcastto get an actual numeric from which to sort by:Note,
ltrimalso works if you have multiple currencies. Just line them all up, like'$€'.ltrimremoves any and all characters from the left side until it hits a character that’s not in that string.