【问题标题】:Finding Jan 1st of current year in HQL在 HQL 中查找当年的 1 月 1 日
【发布时间】:2022-01-08 07:16:26
【问题描述】:

我有一个将 HQL 查询传入数据库的 python 函数,我需要使用 hive 来查找 (currentYear)-01-01

def foo():
    return " SELECT variables \
        FROM bar \
        WHERE \
        fizz = buzz \
        AND to_date(somedate) > date_format(current_date,'yyyy-01-01') "

最后一行当前不工作

【问题讨论】:

    标签: python date hql


    【解决方案1】:

    好尴尬。

    to_date(somedate) > date_format(current_date,'yyyy-01-01')
    

    这完全符合预期。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-02
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 2017-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多