选择sum = SpecifiedQuantity的记录 [英] Select those records whose sum=SpecifiedQuantity

查看:139
本文介绍了选择sum = SpecifiedQuantity的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Id  Qty
A   48.17
B   48.52
C   45.44
D   45.76
E   48.12
F   46.48
G   45.23
H   43.89
I   43.93
J   47.34





在上面的数据中有10条记录,我想只选择那些总和= 227.33



In above data there are 10 records,i want to select only those records whose sum=227.33

推荐答案

A的记录据我所知,你根本不能在SQL中做到这一点 - 或者如果可以的话,它将是非常复杂的。在完整的编程语言中,包括数组,递归和构建复杂结构的能力并不简单 - 您可能需要获得所需的结果。



甚至不要尝试使用SQL - 而是在业务层中执行此操作。
As far as I know, you cannot do this in SQL at all - or if you can it would be hideously complex. It isn't simple in a full programming language which includes arrays, recursion and the ability to build complex structures - which you would probably need to get the result you want.

Don't even try in SQL - do it in your business layer instead.


这篇关于选择sum = SpecifiedQuantity的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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