本文介绍了如何在三个表中创建计算列,如果我们改变一个,则自动进行另一个更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3张表

Collectoin | WorckForm | WorckFormData



1)Collecton:total_amount

2)WorckForm:total_amount,receive_amount,due_amount

3)WorckFormData :total_amount,receive_amount,due_amount





1)我在收集表中插入总金额。

2 )当我在每个交易中的数据到期时插入在worckformdata中。

3)我想要最终计算列并保留在worckform表中插入的金额



Ex:



收藏:

total_amount = 5000



worckformdata:

totalamount = 5000

receive_amount = 2000

due_amount = 3000



totalamount = 2000

receive_amount = 500

due_amount = 1500



worckform:

totalamount = 2000

receive_amount = 500

due_amount = 1500





如何我在这些列之间的关系或计算。

解决方




I have 3 Table
Collectoin | WorckForm | WorckFormData

1)Collecton: total_amount
2)WorckForm: total_amount, receive_amount, due_amount
3)WorckFormData:total_amount, receive_amount, due_amount


1) i insert in collection table, total amount.
2) when i due amount from data every transaction insert in worckformdata.
3) i want finally computed column and remain amount inserted in worckform table

Ex:

Collection:
total_amount=5000

worckformdata:
totalamount=5000
receive_amount=2000
due_amount=3000

totalamount=2000
receive_amount=500
due_amount=1500

worckform:
totalamount=2000
receive_amount=500
due_amount=1500


How i relation OR computed between these column.

解决方案




这篇关于如何在三个表中创建计算列,如果我们改变一个,则自动进行另一个更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-23 02:20