将SQL查询转换为Hive查询

时间:2014-09-29 09:58:59

标签: mysql hive

任何人都可以告诉我如何将以下SQL查询转换为Hive Query ...

SELECT  GL_ACCT_ID ACCT_ID, gl_acct_nm as acct_nm,DA_REC_EFF_DT
FROM DSMT_GL_ACCT
WHERE setid ='FDL01'
AND ACCT_TYP_CD IN ('E')
AND DA_REC_EFF_DT>= TO_DATE(:P_ACTG_PRD_NO||'-'||:P_FYR,'MM-YYYY')

先谢谢

2 个答案:

答案 0 :(得分:0)

尝试使用' $ {P_ACTG_PRD_NO}' &安培; ' $ {} P_FYR'

答案 1 :(得分:0)

SELECT  GL_ACCT_ID ACCT_ID, gl_acct_nm as acct_nm,DA_REC_EFF_DT
FROM DSMT_GL_ACCT
WHERE setid ='FDL01'
AND ACCT_TYP_CD IN ('E')
AND DA_REC_EFF_DT>=from_unixtime(unix_timestamp('${P_ACTG_PRD_NO}-${P_FYR}','MM-yyyy'),'MM-yyyy')