34,838
社区成员




create table tb( reco_no int, num int, cc as reco_no*num)
insert tb select 1, 2
union all select 2, 1
union all select 10, 3
select * from tb
/*
reco_no num cc
----------- ----------- -----------
1 2 2
2 1 2
10 3 30
(3 row(s) affected)
*/
alter table tb drop column cc
alter table tb add cc as reco_no+num
select * from tb
/*
reco_no num cc
----------- ----------- -----------
1 2 3
2 1 3
10 3 13
(3 row(s) affected)
*/
drop table tb
create table tb( reco_no int, num int, cc as reco_no*num)
insert tb select 1, 2
union all select 2, 1
union all select 10, 3
select * from tb
/*
reco_no num cc
----------- ----------- -----------
1 2 2
2 1 2
10 3 30
(3 row(s) affected)
*/
drop table tb