create table test( col1 int, col2 float, col3 as cast(col1+col2 as decimal(18,1)))--插入数据insert test values(1,2.111)insert test values(2,3.1)insert test values(3,3)--看结果select * from test /*col1 col2 col3----------- ---------------------- ---------------------------------------1 2.111 3.12 3.1 5.13 3 6.0*/