Created
May 11, 2017 05:25
-
-
Save puzanov/b38e5904dbf08ea7f9b2a345609ba481 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
m.source_host, | |
m.external_link, | |
m.count, | |
m.external_host, | |
m.created, | |
coalesce(t1.hosttype,'N') as 'source_host_type', | |
coalesce(t2.hosttype,'N') as 'external_host_type' | |
from monitor as m | |
LEFT OUTER JOIN types as t1 ON t1.hostname=m.source_host | |
LEFT OUTER JOIN types as t2 ON t2.hostname=m.external_host | |
where | |
m.external_host not in (select distinct external_host from monitor where created < '2017-01-12') | |
and m.created between '2017-01-12 00:00:00' and '2017-01-12 23:59:59'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment