Hive 中的查询语法
Query Syntax in Hive
我们如何将 Oracle 中的以下查询转换为 Hive 兼容的 ANSI SQL 语法?
请帮忙。
SELECT C.BUSINESS_UNIT_CA, (SELECT C1.DESCR FROM HIVE_TABLE_C1 C1 WHERE C.BUSINESS_UNIT_CA = C1.BUSINESS_UNIT) AS CA_BU_DESCR FROM HIVE_TABLE_C C
使用LEFT JOIN
重写:
SELECT C.BUSINESS_UNIT_CA, C1.DESCR AS CA_BU_DESCR
FROM HIVE_TABLE_C C
LEFT JOIN HIVE_TABLE_C1 C1 ON C.BUSINESS_UNIT_CA = C1.BUSINESS_UNIT
我们如何将 Oracle 中的以下查询转换为 Hive 兼容的 ANSI SQL 语法? 请帮忙。
SELECT C.BUSINESS_UNIT_CA, (SELECT C1.DESCR FROM HIVE_TABLE_C1 C1 WHERE C.BUSINESS_UNIT_CA = C1.BUSINESS_UNIT) AS CA_BU_DESCR FROM HIVE_TABLE_C C
使用LEFT JOIN
重写:
SELECT C.BUSINESS_UNIT_CA, C1.DESCR AS CA_BU_DESCR
FROM HIVE_TABLE_C C
LEFT JOIN HIVE_TABLE_C1 C1 ON C.BUSINESS_UNIT_CA = C1.BUSINESS_UNIT