Skip to content

Instantly share code, notes, and snippets.

View reecestart's full-sized avatar
💻

Reece reecestart

💻
View GitHub Profile
@reecestart
reecestart / select-rows-with-status-that-have-changed.sql
Created May 10, 2017 21:02
Select Rows with Status that has Changed
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;
@reecestart
reecestart / create-athena-table-for-csvs.sql
Created May 10, 2017 20:58
Create Athena Table for CSVs
CREATE EXTERNAL TABLE IF NOT EXISTS athenadatabaseforcsvs.athenatableforcsvs (
aws_account_id string,
name string,
email string,
status string,
category string,
description string,
refreshed string,
processed string,
flagged string,