写了一个视图,但是老实提示错误。create view indadd_totalviewas
(
 declare @A decimal(16,2)
 declare @B decimal(16,2)
 declare @C decimal(16,2)
 declare @D decimal(16,2)
 declare @E decimal(16,2)
  select @A=dfa_current,
        @B=(Wg_Payable+Bf_Payable+Fg_Payable+Oth_Payable)*1.08+Ass_Exp+Allow+Othallow+Kind_Inc,
        @C=VAT+Sales_Tax+Mng_Tax+Add_Tax+Oth_Tax,
        @D=Sales_Profit+Allow_Inc+Bddt_For+Cut_For+Ent_Exp+Delvp_Exp+Res_Fund+Gk_Exp+Oth_Inc,
        @E=@A+@B+@C+@D from indadd_sheet
)这样写行不行的啊?

解决方案 »

  1.   

    我要返回,变量@A @B @C @D @E的值
      

  2.   

    --改为
    Create view indadd_totalviewas
     Select a,b,c,d,a+b+c+d as e
     from (
     select  A=dfa_current,
             B=(Wg_Payable+Bf_Payable+Fg_Payable+Oth_Payable)*1.08+Ass_Exp+Allow+Othallow+Kind_Inc,
             C=VAT+Sales_Tax+Mng_Tax+Add_Tax+Oth_Tax,
             D=Sales_Profit+Allow_Inc+Bddt_For+Cut_For+
               Ent_Exp+Delvp_Exp+Res_Fund+Gk_Exp+Oth_Inc from indadd_sheet
    ) as t
    go