By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE foo ( a int );
INSERT INTO foo VALUES (1),(2),(3);
3 rows affected
ALTER TABLE foo ADD b varchar ;
UPDATE foo SET b = CAST( a AS varchar );
ALTER TABLE foo DROP COLUMN a;
3 rows affected
SELECT * FROM foo;
b |
---|
1 |
2 |
3 |