我要把tableA中的A字段下的所有记录(数字型)乘以tableB下b字段下的相应记录(通过id号一一一对应,)得到结果显示在tableA下C字段中,用程序可不可以实现?

解决方案 »

  1.   

    能否详细说明一下,
    如果说的再简单点,在table下,怎样做到A字段*B字段=C字段 如:
    A   B   C
    2   3   6
    8   9   72
    3   4   12
    ... ..   ..
      

  2.   

    select t1.a,t2.b,t1.a*t2.b as c from t1,t2 where t1.id=t2.id
      

  3.   

    用tquery的sql为select tablea.a,tableb.b from tablea,tableb where tablea.id=tableb.id a:=query1.fields[0].value
    b:=query1.fields[1].value
    用tablea 的计算事件
    tablea.c:=a*b
      

  4.   

    update table set c=a*b
    where t1.id=t2.id