Created
October 23, 2014 09:54
-
-
Save StanAngeloff/b26c7cbc31d75f10d198 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 "log"."audit"->>'entity' "entity", "log"."audit"->>'requestId' "requestId", "log".* | |
FROM "audit_log" "log" | |
WHERE ("log"."audit"->>'requestId') IS NOT NULL AND NOT EXISTS ( | |
SELECT 1 | |
FROM "audit_log" "log2" | |
WHERE ("log2"."audit"->>'requestId')::numeric = (("log"."audit"->>'requestId')::numeric - 1) | |
AND ("log2"."audit"->>'entity') = ("log"."audit"->>'entity') | |
) | |
ORDER BY "log"."audit"->>'entity' ASC, "log"."date_logged" ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment