Skip to content

Instantly share code, notes, and snippets.

@yssymmt
Created September 19, 2022 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yssymmt/c6e19415f795cb19c3e97a7cea6e49ed to your computer and use it in GitHub Desktop.
Save yssymmt/c6e19415f795cb19c3e97a7cea6e49ed to your computer and use it in GitHub Desktop.
select
a1.docid,
topic0score,
topic1score,
topic2score,
word as doc
from (
select
docid,
max(case when topicid=0 then score else null end) as topic0score,
max(case when topicid=1 then score else null end) as topic1score,
max(case when topicid=2 then score else null end) as topic2score
from jumbo.aud13_ldascore
group by 1
) a1 left outer join (
select
docid,
word
from jumbo.aud11_denorm
) a2
on a1.docid=a2.docid
order by 1
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment