在HIVE / SPARK SQL中等价



我试图将Teradata SQL查询转换为HIVE/Spark SQL等效。qualifycount是否有替代品

SELECT
PARENT_ID, CHILD_ID
from db.source_table
QUALIFY COUNT(CHILD_ID) OVER (PARTITION BY  PARENT_ID)=0

明白了

select 
PARENT_ID, 
CHILD_ID
from 
(select PARENT_ID, CHILD_ID, 
count(CHILD_ID) over (partition by PARENT_ID order by PARENT_ID asc) as COUNT_PARENT_ID 
from db.source_table
) where COUNT_PARENT_ID = 0

相关内容

  • 没有找到相关文章

最新更新