Reputation: 31
I have a postgresql table named baseballs with a column named quantity of type = varchar and would like to populate the quantity_integer column with type = integer
baseballs
quantity
quantity_integer
How would I write a SQL statement?
Upvotes: 3
Views: 2649
Reputation: 425238
update baseballs set quantity_integer = quantity::int;
Upvotes: 9