Last active
December 31, 2015 17:59
-
-
Save philihp/8023422 to your computer and use it in GitHub Desktop.
query for aaron
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 c.name, m.serialnumber, | |
first_value(l.username) over (order by l.timestamp desc) as username | |
from machines m | |
inner join computersmachine cm on (m.id=cm.machineid) | |
inner join computers c on (cm.computerid=c.id) | |
left join logins l on (l.machineid=m.id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment