例如:select express from result    输出:[(A1+A2)*A3)]、[(A1+A4)*A3]、[A1*A4/A3]...
每个[]里都是输出的结果。我在 另一个表里 定义了 这四个变量的值
  
   id   A1   A2   A3   A4
    1   12     5      8      9
    2   5      8      3      1
    3   6      4      13     4
能不能在查询出来的时候 将 A1.A2.A3.A4 这个四个变量 换成 对应的数字。

解决方案 »

  1.   

    没看懂意思,请:
    最好给出完整的表结构,测试数据,计算方法和正确结果.发帖注意事项
    http://topic.csdn.net/u/20091130/21/fb718680-98ff-4afb-98d8-cff2f8293ed5.html?24281
      

  2.   


    --> 测试数据:[TB]
    if object_id('[TB]') is not null drop table [TB]
    create table [TB]([id] int,[A1] int,[A2] int,[A3] int,[A4] int)
    insert [TB]
    select 1,12,5,8,9 union all
    select 2,5,8,3,1 union all
    select 3,6,4,13,4select * from [TB]select  [(A1+A2)*A3]=(A1+A2)*A3,
    [(A1+A4)*A3]=(A1+A4)*A3,
    [A1*A4/A3]=A1*A4/A3
    from TB/*
    (A1+A2)*A3  (A1+A4)*A3  A1*A4/A3
    ----------- ----------- -----------
    136         168         13
    39          18          1
    130         130         1(3 行受影响)*/
      

  3.   

    不是很懂,你是不是想根据结果求A1,A2,A3,A4啊
      

  4.   

    select可以直接运算select (A1+A2)*A3),(A1+A4)*A3,A1*A4/A3 from  result