删除“分组依据”运行时来自 QueryBuildDataSource 的语句
我需要从 QueybuildDataSource 对象中删除 group by 语句。 有什么方法可以做到这一点吗? (与 addGroupByField 相反)。
I need to remove a group by statement from a QueybuildDataSource object.
Is there any method to do this? (The opposite of addGroupByField).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
@Artem,我认为你无法从 QBDS 级别做到这一点。我认为你需要从 query().clearGroupBy(); 执行此操作
@ian_scho,信誉度低于 100 的用户在发布后 4-8 小时内无法回答自己的问题......这可能就是他没有发布答案的原因。
@Artem, I don't think you can do it from the QBDS level. I think you need to do it from query().clearGroupBy();
@ian_scho, users under 100 reputation can't answer their own questions for 4-8 hours after posting...that's probably why he didn't post as an answer.
您尝试过吗?...
然后您可以添加要以编程方式分组的字段。例如,模仿 Select Distinct 子句。
Have you tried?...
You can then add fields to be grouped programmatically. Mimmicking a Select Distinct clause for example.
不幸的是,x++ 没有任何方法从 group by 中删除一个字段,但通过一些技巧我们可以做到这一点。我编写了一种用于删除分组依据字段的方法:
为了获得更好的性能,您可以更改此方法以输入您想要从分组依据中删除的字段 Id 的容器。
Unfortunately, x++ does not have any method to remove one field from group by but by some tricks we can do that. I have written a method for removing group by field:
And for better performance u can change this method to input container of field Id which u want to remove from group by.