I want to trim some numbers to two digits and get the max value from it.
My table column is called "thousands" (int4) and has values like:
I expect to receive the value 12, because after trimming the numbers to a max. of two digits, 912 should be transformed to 12 which is higher than 11, but I receive 7 using the query:
SELECT MAX(RIGHT("thousands"::varchar, 2))
FROM "numbers"
I guess RIGHT([string], [number of digits from right to left]) is messing up when the value has less digits than requested, but I don't know how to achieve the demanded solution. Can anybody help please?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…