Skip to content

Instantly share code, notes, and snippets.

@a1994sc
Created July 7, 2016 22:59
Show Gist options
  • Save a1994sc/09ee967197b213fcb88b6929be9ab5ee to your computer and use it in GitHub Desktop.
Save a1994sc/09ee967197b213fcb88b6929be9ab5ee to your computer and use it in GitHub Desktop.
select trim(SUBSTR(reward, 1, LENGTH(reward) - 6)) as Name,
count(reward) as Occurance
from Alerts as A
where
(
Name in (
select N.Name as Name
from Nightmare as N
) or Name in (
select Au.Name
from Aura as Au
)
)
and A.read_time like "%Jul%16"
group by Reward
union
select Nm.Name as Name,
0 as Occurance
from Nightmare as Nm
where Name not in (
select trim(SUBSTR(A.reward, 1, LENGTH(A.reward) - 6)) as Name
from Alerts as A
where A.read_time like "%Jul%16"
and reward like "%(Mod)"
)
union
select Au.Name as Name,
0 as Occurance
from Aura as Au
where Name not in (
select trim(SUBSTR(A.reward, 1, LENGTH(A.reward) - 6)) as Name
from Alerts as A
where A.read_time like "%Jul%16"
and reward like "%Aura)"
)
order by Occurance desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment