美文网首页
Hive Sql case when 不支持子查询

Hive Sql case when 不支持子查询

作者: 万事皆成 | 来源:发表于2019-12-21 11:23 被阅读0次

how to make selecet subquery in hive sql

怎么在 hive sql 中实现 select 子查询
使用 row_number()处理
例如:

select zoneno, protseno, notetype, currtype, amount, workdate
from
    (select zoneno, protseno, notetype, currtype, amount, workdate, row_number()
        over (partition by zoneno, protseno, notetype order by amount desc, workdate) rnum
        from abd_f.fcm_abd_f_dftmodtl_s) a
where a.rnum = 1

参考:

HIVE - hive subquery is not working with case when statement with IN clause

官网:LanguageManual SubQueries

官网:Subqueries in SELECT

相关文章

网友评论

      本文标题:Hive Sql case when 不支持子查询

      本文链接:https://www.haomeiwen.com/subject/tvgzgctx.html