Created
September 19, 2022 16:56
-
-
Save yssymmt/c96f055e203acd746084702596cc7637 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
topicid, | |
word, | |
prob, | |
max(aa) over(partition by word) as pickbest, | |
dense_rank() over(partition by topicid order by prob desc) as ranko | |
from ( | |
select | |
topicid, | |
word, | |
prob, | |
case when max(prob) over(partition by word)=prob then topicid else null end as aa | |
from jumbo.aud12_ldamodel | |
) a1 | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment