According to the docs and this tutorial. I can use;
CAST ( expression AS type );
I have a series of values stored as text which are monetary values (formatted as 200.00 i want to be decimal so I have attempted;
SELECT totalvalue
CAST (table.totalvalue AS decimal(12,2))
FROM table;
But this just returns an error on the syntax
ERROR: syntax error at or near "CAST"
I've tried swapping the type from decimal to integer but i get the same problem.
Postrgres 9.6.2
CAST ..., which won't work. This should be at least something likeSELECT CAST (table.totalvalue AS decimal(12,2)) FROM table;as the tutorial you linked does explain.totalvalue). Try:SELECT totalvalue, CAST (table.totalvalue AS decimal(12,2)) FROM table;UPDATE d_voa_record1 SET totalvalue = CAST (totalvalue AS numeric(12,2));It runs through but doesn't change the records