The alternate view in the Item Status screen shows a "Total Circs"
field that was under-counting circulations because UNION filtered
out duplicates. This commit replaces UNION with UNION ALL, which
allows duplicate rows.
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
asset.copy cp
JOIN action.circulation circ ON (cp.id = circ.target_copy)
GROUP BY 1, 3, 4
- UNION
+ UNION ALL
SELECT
cp.id as copy,
COUNT(circ.id),
asset.copy cp
JOIN action.aged_circulation circ ON (cp.id = circ.target_copy)
GROUP BY 1, 3, 4
- UNION
+ UNION ALL
SELECT
id as copy,
circ_count,