lets assume I have a table with this entries:
thing: position: ball 1001.25 pensil 1001.0625 car 1002.5 watch 1003.0035
And I want to run a function or query over the whole position column to change the numbers and remove the decimal point but keep the type as numeric type and keep the same positions (ordering). So I want to look it like the following after the update:
I want the table to look like this after the query: -->
thing: position: ball 2 pensil 1 car 3 watch 4
so when I order by position asc I still get the right order but I cleaned up the decimal points.
pensil 1 ball 2 car 3 watch 4
What is a good approach to make this in order to refresh the whole position column?
That is my Table:
create table numeric_test ( thing text, position numeric(1000,993) unique, );