Athena Min()功能使无效
我试图带回三个不是无效的属性的最小日期。可能会有多行,所以我需要分组以找到键的属性的最低日期,而三个最低数字中的最低数字
因此,对于下面的图像,我想返回09/09/00,问题是min(),因为最低的值和操作员也这样做。有很好的解决方案吗?
我们想要第一个和第二个日期的最小
key date_1 date_2 Date_3
1 12/31/12 1/2/18 NULL
1 5/3/15 5/17/08 3/17/19
1 NULL 9/9/00 9/28/07
I am attempting to bring back the smallest date of three attributes that is not null. There could be multiple rows so I need to group to find the lowest of date of the attribute for the key and the lowest of the three lowest numbers
So with the image below I would want to return 09/09/00 the problem is MIN() keeps bringing back null as the lowest value and operators do the same. Is there a good solution for this?
We want the min of the first and second date and if both of all of those dates are null return the min third_date
key date_1 date_2 Date_3
1 12/31/12 1/2/18 NULL
1 5/3/15 5/17/08 3/17/19
1 NULL 9/9/00 9/28/07
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在此处使用
Union
方法:请注意,您应该避免命名
键
,这通常是保留的SQL关键字。You could use a
UNION
approach here:Note that you should avoid naming your columns
key
, which is usually a reserved SQL keyword.