日期:2014-05-18 浏览次数:20452 次
go if OBJECT_ID('test')is not null drop table test go create table test( a int, b int, c int, d int, e int, f int ) go insert test select 1,2,4,3,5,6 union all select 2,3,1,6,5,7 --如果是处理表里的数据: select a*a+c/b+d*e+f+c*c*c as value from test /* value 88 42 */ go if OBJECT_ID('pro_tracy')is not null drop proc pro_tracy go create proc pro_tracy @a int,@b int,@c int,@d int,@e int,@f int as select @a*@a+@c/@b+@d*@e+@f+@c*@c*@c as total exec pro_tracy 1,2,4,3,5,6 /* total 88 */
------解决方案--------------------
select square(a) + b/c + d*e + (f + power(c, d)) from m;