create table ta(A int,B int,C int ,D as A+B+C)测试: insert ta select 1,2,3 显示: select * from ta A B C D ----------- ----------- ----------- ----------- 1 2 3 6(所影响的行数为 1 行)
如果是排序而已 就这样就行了 create table ta(A int,B int,C int ) select * from ta order by A+B+C desc
insert ta
select 1,2,3
显示:
select * from ta
A B C D
----------- ----------- ----------- -----------
1 2 3 6(所影响的行数为 1 行)
就这样就行了
create table ta(A int,B int,C int )
select * from ta order by A+B+C desc