-
-
Save jeff/fccb56ea0181b24c5d096d4c9281a537 to your computer and use it in GitHub Desktop.
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
day | age | |
------------+---------- | |
2008-11-09 | 10 years | |
(1 row) |
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 | |
date_trunc('day', create_date)::DATE AS day, | |
age(now()::DATE, date_trunc('day', create_date)::DATE) AS age | |
FROM asset.call_number | |
WHERE owning_lib IN ( | |
SELECT id FROM actor.org_unit_descendants( | |
(SELECT id FROM actor.org_unit WHERE shortname = 'TADL') | |
) | |
) | |
GROUP BY day, age | |
ORDER BY count(*) DESC | |
LIMIT 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment