Created
May 10, 2017 21:02
-
-
Save reecestart/9280675fadedd29e48413bf51e2350cc to your computer and use it in GitHub Desktop.
Select Rows with Status that has Changed
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 a.aws_account_id, a.name, a.description, a.refreshed, a.status | |
FROM | |
athenatableforcsvs AS a | |
INNER JOIN | |
athenatableforcsvs AS b | |
ON a.aws_account_id = b.aws_account_id AND a.description = b.description | |
WHERE | |
a.status <> b.status | |
GROUP BY a.aws_account_id, a.name, a.description, a.refreshed, a.status | |
ORDER BY 1, 2, 3, 4, 5; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment