select a,b,(b/3)*a as c
from table

解决方案 »

  1.   

    select a,b,b/3*a as c from yourtable
      

  2.   

    这个例子这样可以,问题是有不是3的啊表table 
    列 a,b
    内容是
    a   b   
    2   8
    1   4其中的a是指倍尺数,b是指定尺长度,内的值是一样的
    如何得到这样的结果:
    a   b    c(长度)
    2   8    8      --(8/2)*2
    1   8    4     --(8/2)*1就是说a中的最大值是个变的。
      

  3.   

    select a,b,b/(select max(a) from yourtable)*a as c from yourtable
      

  4.   

    最后一点了
    得到
    a      b    c(长度)
    定尺   8    8      --(8/2)*2
    1      8    4     --(8/2)*1case when 用的老出错:
    大家给看看:
    convert(varchar(1),倍尺数)+ case when 倍尺数  in (select max(倍尺数) from #tmp4) then '定尺 /' else '倍尺 /'+convert(varchar(10),convert(decimal(5,2),定尺长度/(select max(convert(decimal(5,2),倍尺数)) from #tmp4)*convert(decimal(5,2),倍尺数)))+'m'as 倍尺数
      

  5.   

    少了个end
    不过好象还是不对,前面那个数本该不要的