我试图将Teradata SQL
查询转换为HIVE/Spark SQL
等效。qualify
和count
是否有替代品
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