使用更新查询减去2列不同的表 [英] subtracting 2 columns of different tables with a update query

查看:89
本文介绍了使用更新查询减去2列不同的表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想减去两个不同表中的2列,并在其中一个表中更新说,

i有两个表''main''和''sub''两个表都有一个名为的列数量所以我必须这样做:


更新主要设定数量=((主要数量) - (数量))其中name = pens;


请有人帮帮我。

I want to subtract 2 column of two different tables and update in one of the table say,
i have two tables ''main'' and ''sub'' both tables have a column named ''quantity'' so i have to do it in this way:

update main set quantity = ((quantity of main) - (quantity of sub)) where name = pens;

Somebody help me please.

推荐答案

你已经解决了它!

构建链接name的两个表的查询。字段(btw是保留字......你应该改变它)现在在两个数量字段之间创建一个计算字段。
You''ve solved it right there!

Build your query linking the two tables on the "name" field (which btw is a reserved word... you should change that) now create a calculated field between the two quantity fields.


我试过这样做,
i tried doing so,
展开 | 选择 | Wrap | 行号


HI!你也可以试试这个:
HI ! you can also try this :
展开 | 选择 | Wrap | 行号


这篇关于使用更新查询减去2列不同的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆