首页 \ 问答 \ 使用agregate和条件查询而不加入(Bigquery标准sql)(Query with agregate and condition without join (Bigquery standard sql))

使用agregate和条件查询而不加入(Bigquery标准sql)(Query with agregate and condition without join (Bigquery standard sql))

我在表格中有这些数据

column 1    column 2    condition   value
1   ABC 1   1
1   строка 2    0   1
1   строка 3    0   1
1   строка 4    0   1
1   строка 5    0   1
1   строка 6    0   1
2   BCD 1   1
2   строка 2    0   1
2   строка 3    0   1

我不会有这个结果:

column 1    column 2    sum of value
1   ABC 6
2   BCD 3

此结果仅按第一列分组。 第二列显示条件为1的那些行上的值。在第三列中,我们得到列值的总和,不包括任何条件。 是否可以在没有连接的情况下执行此操作(因为表非常大)


I have this data in table

column 1    column 2    condition   value
1   ABC 1   1
1   строка 2    0   1
1   строка 3    0   1
1   строка 4    0   1
1   строка 5    0   1
1   строка 6    0   1
2   BCD 1   1
2   строка 2    0   1
2   строка 3    0   1

And I wont to have this Result:

column 1    column 2    sum of value
1   ABC 6
2   BCD 3

This result is grouped by the first column only. The second column shows the values that are on those lines where the condition is 1. In the third column, we get the sum over the column value, not including any conditions. Is it possible to do this without join (because table very large)


原文:https://stackoverflow.com/questions/47471073
更新时间:2023-06-28 18:06

最满意答案

@ @ jiliagre,我正在回答我自己的问题。 我通过从Glassfish 4.1升级到4.1.1来解决问题


Per @jiliagre, I'm answering my own question. I fixed the problem by upgrading from Glassfish 4.1 to 4.1.1

相关问答

更多
  • 它可能与Glassfish更新模块有关。 在每个控制台启动期间,更新模块会尝试对所有可用更新进行计数。 自从使用GF 3.0.1以来,自从2月28日发布新的Glassfish 3.1以来,有很多更新。 从那天起,可以有多达70次更新或更多更新服务器处理大量请求。 我有同样的问题。 但我可以通过最终在Glassfish的Jira中找到一个好的讨论主题来解决它。 寻找可能的解决方案 。 你不需要阅读整篇文章,查看来自Sun,2009年12月13日12:42:48的摘要文章。 总结这篇文章(细节可以在那里找到): ...
  • 关于Oracle GlassFish Server 3.1升级指南,您做得对。 本指南中提供了一些有关已部署应用程序迁移的提示: 部署在源服务器中的应用程序归档(EAR文件)和组件归档(JAR,WAR和RAR文件)不需要在Oracle GlassFish Server 3.1上运行任何修改。 可能具有不兼容性的组件部署在GlassFish Server 3.1上,兼容性属性设置为v2,并且将在GlassFish Server 3.1上无需更改即可运行。 但是,您可能需要考虑修改应用程序以符合Java EE ...
  • 问题是Glassfish内部的一个错误。 我已经切换到Payara,现在没问题,即使为了完成4次测试(和2次部署),也需要2分钟。 我不知道这是否是可以接受的时间? The problem is a bug inside Glassfish. I've switched to Payara and now it is fine, even if in order to complete 4 tests(and 2 deploys) it takes 2 minutes. I don't know if th ...
  • 这个晚期BSD功能在2008年标准化,而Solaris 9在2001年发布,Solaris 10在2005年发布。这就是为什么它不适用于这些版本的原因。 dirfd适用于当前版本Solaris 11。 对于较旧的,重新实现dirfd似乎是显而易见的,因为文件描述符已经在传递的结构中,这里dir->d_fd或dir->dd_fd取决于是否定义了__XOPEN_OR_POSIX 。 This late BSD function was standardized in 2008 while Solaris 9 w ...
  • exit是一个内置的外壳。 想想一个外壳通常如何在没有内建的情况下工作。 它通过分叉一个新进程来执行命令路径中的一个文件。 退出终止当前进程。 如果有外部exit程序,调用它就会退出exit程序。 因此, exit是bash本身(和其他shell)知道如何解释(和cd )的内置命令之一。 它只是在流程内部进行exit 。 对维基百科的优秀解释: http : //en.wikipedia.org/wiki/Shell_builtin exit is a shell built-in. Think about ...
  • @ @ jiliagre,我正在回答我自己的问题。 我通过从Glassfish 4.1升级到4.1.1来解决问题 Per @jiliagre, I'm answering my own question. I fixed the problem by upgrading from Glassfish 4.1 to 4.1.1
  • 我们设法通过相同的命令安装memcache但是当它要求会话保留在memcache中时,你需要说'No'然后它正确安装。 检查这是否有助于你.. 谢谢,维杰 We managed to install memcache by the same command but when it ask for session to keep in memcache, you need to say 'No' then it installs correctly. Check if this helps you.. Tha ...
  • 给那些p:message组件一个id并将它们放在p:commandLink的更新中: ...
    如果你查看http://www.boost.org/users/history/version_1_48_0.html ,你会看到两个编译器列表。 “主要”编译器是针对该版本进行测试的编译器。 那里没有基于Solaris的编译器。 第二个列表是针对中继线进行测试的(每天或多或少)。 Sun编译器v 5.10就在该列表中。 现在,您可以查看http://www.boost.org/development/tests/trunk/developer/summary.html ,找到该编译器的测试结果。 从那里, ...
  • Solaris不是类Unix / Linux系统。 这是一个真正的Unix系统 - 无论如何,根据单Unix规范 ,以及AIX和OS X. 这是一个很大的话题,但我认为它们之间最大的区别在于Linux(内核)是完全开源的,而Solaris则不是。 Oracle还为操作系统提供供应商级支持。 Chris O也提出了一个好点。 如果您正在运行Sun SPARC体系结构(这种情况目前非常罕见),那么您可能会获得更好的Solaris支持,而不是任何Linux发行版。 这篇文章有点冗长,你可能会觉得值得一读。 看看这 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)