如何总和减去int货币

发布于 2025-02-11 06:22:44 字数 885 浏览 1 评论 0原文

我有一个带正数和负数和预算表的交易表。如果预算负,负数将增加。

bud_tab

ID预算
190
280
350
430

trans_tab

IDtrans
1-50
280
3-70
460

输出

这样
获得应该
什么
查询使用
3060-30

I have a transaction table with positive and negative numbers and a budget table. A negative number will increase if being minus with budget.

bud_tab

idbudget
190
280
350
430

trans_tab

idtrans
1-50
280
3-70
460

What query should I use to get an output like this:

budgettranstotal
90-50140
80800
50-70120
3060-30

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木槿暧夏七纪年 2025-02-18 06:22:44

从输出的外观来看,这似乎是一个基本的数学计算。我想念什么吗?

select budget, trans, budget - trans as total from bud_tab natural join trans_tab ;

From the look of output, this seems like a basic math calculations. Am I missing something ?

select budget, trans, budget - trans as total from bud_tab natural join trans_tab ;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文