尝试将2个查询和一个表单的数据组合到数据库插入中 [英] Trying to combine 2 queries and one form's data into database inserts

查看:44
本文介绍了尝试将2个查询和一个表单的数据组合到数据库插入中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好


我有一个查询,我得到整个基金的单位总数


说基金89总共1000单位


然后我需要知道每个用户有多少资金


说用户6有500个单位

表示用户7有400个单位

表示用户8有100个单位


我有一个表单,你输入一个美元金额和%总计单位分配给每个用户


表示该基金获得1000美元。我需要插入三笔交易

其中用户6获得$ 500(50%),用户7 $ 400(40%)和用户8 $ 100(10%)


是进行2次单独查询并将结果组合在一起进行3次插入的正确方法吗?


我试图获取表单数据,但我无法进行来自其他两个队列的数字来完成这项工作。任何人都可以给我一些关于如何以正确的方式做到这一点的想法


谢谢

Hello

I have one query where i get the total number of units for an entire fund

say fund 89 has 1000 total units

Then i need to find out how much of the total fund each user has

say user 6 has 500 units
say user 7 has 400 units
say user 8 has 100 units

I have a form where you put in a dollar amount and the % of the fotal units are allocated to each user

say the fund get 1000 dollars. i need to insert three transactions
where user 6 gets $500( 50%), user 7 $400(40%) and user 8 $100( 10%)

Is the right way to do 2 separate queries and combine the results together to do the 3 inserts?

I have tried to get the form data which I can but i am unable to the numbers from the other two queies to make this work. Can anyone give me some ideas on how this should be done the right way

Thanks

推荐答案

500(50%) ,用户7
500( 50%), user 7


400(40%)和用户8
400(40%) and user 8


100(10%)


是正确的方法来做两个单独的查询并将结果组合在一起进行3次插入吗?


我试图获取表单数据,但我无法使用数字从其他两个队列来完成这项工作。任何人都可以给我一些关于如何以正确的方式做到这一点的想法


谢谢
100( 10%)

Is the right way to do 2 separate queries and combine the results together to do the 3 inserts?

I have tried to get the form data which I can but i am unable to the numbers from the other two queies to make this work. Can anyone give me some ideas on how this should be done the right way

Thanks


这篇关于尝试将2个查询和一个表单的数据组合到数据库插入中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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