SQl issue adding a char before id field , how?
CREATE TABLE customer
(id varchar,
sal int);
insert into customer values (1,500);
insert into customer values (2,500);
insert into customer values (3,500);
insert into customer values (4,500);
select开发者_Python百科 * from customer;
update customer set id = 'sss'+id;
select * from customer;
My ideone link
I missed the 'sss' word before the id while creating, I thought update would do it, but how?
update customer set id = 's' || cast(id as varchar(10));
Works in your IdeOne environment.
精彩评论