Skip to content

Instantly share code, notes, and snippets.

@jeff
Created July 25, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeff/dce623f349c74b714ee160e66803bdfe to your computer and use it in GitHub Desktop.
Save jeff/dce623f349c74b714ee160e66803bdfe to your computer and use it in GitHub Desktop.
SELECT id, xact_start, checkin_time, checkin_scan_time, checkin_workstation, checkin_staff
FROM action.circulation AS circ
WHERE checkin_time IS NOT NULL
AND NOT EXISTS (SELECT 1 FROM action.circulation WHERE parent_circ = circ.id) -- no "child" circs
ORDER BY circ.checkin_time DESC
LIMIT 100;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment