Skip to content

Instantly share code, notes, and snippets.

@AKB428
Created September 9, 2015 08:20
Show Gist options
  • Save AKB428/83f6748f41ac6697984a to your computer and use it in GitHub Desktop.
Save AKB428/83f6748f41ac6697984a to your computer and use it in GitHub Desktop.
協調フィルタリングデータ生成
SELECT
name,
title,
sum(score) as score
FROM (
SELECT
name,
title,
1 AS score,
FROM (
SELECT
name,
CASE WHEN tweet_text CONTAINS 'Charlotte_AB_'
OR tweet_text CONTAINS 'シャーロット'
OR tweet_text CONTAINS 'Charlotte(シャーロット)' THEN 'シャーロット' WHEN tweet_text CONTAINS 'gakkou_gurashi'
OR tweet_text CONTAINS 'がっこうぐらし'
OR tweet_text CONTAINS 'がっこうぐらし' THEN 'がっこうぐらし' ELSE NULL END AS title
FROM
[2015_C3a.2015_C7a] ) )
WHERE
title IS NOT NULL group by name, title order by name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment