haha...
select code, item, times, money, money*30*times as total from TJGL

解决方案 »

  1.   

    不行,我后面还想用
    SELECT sum(total) AS A from TJGL
    这个语句做求和那
      

  2.   

    那你可以用
    SELECT code, item, times,sum(total) AS A from TJGL group by code, item, times
      

  3.   

    不行
    Invalid column name 'total'.
      

  4.   

    alert table add total Decimal(10) NULL
    select code,money*30*times as total into #mytemp from TJGL
    update TJGL set total=t2.total 
    from TJGL t1
    join #mytemp t2 on t1.code=t2.code 
      

  5.   

    1.alter table TJGL add total decimal(10) null
      go
      update TJGL set total = money*30*times 
      go
      select sum(total) from TJGL
    2.select sum(money*30*times ) from TJGL