joins in the all_circulations reporting view were ... overzealous
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Jun 2009 18:22:31 +0000 (18:22 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Jun 2009 18:22:31 +0000 (18:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13370 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/090.schema.action.sql

index 1140dd4..ba5b1c7 100644 (file)
@@ -161,7 +161,7 @@ CREATE OR REPLACE VIEW action.all_circulation AS
                max_fine_rule, stop_fines
          FROM  action.aged_circulation
                        UNION ALL
-       SELECT  circ.id,COALESCE(a.post_code,b.post_code) AS usr_post_code, p.home_ou AS usr_home_ou, p.profile AS usr_profile, EXTRACT(YEAR FROM p.dob)::INT AS usr_birth_year,
+       SELECT  DISTINCT circ.id,COALESCE(a.post_code,b.post_code) AS usr_post_code, p.home_ou AS usr_home_ou, p.profile AS usr_profile, EXTRACT(YEAR FROM p.dob)::INT AS usr_birth_year,
                cp.call_number AS copy_call_number, cp.location AS copy_location, cn.owning_lib AS copy_owning_lib, cp.circ_lib AS copy_circ_lib,
                cn.record AS copy_bib_record, circ.xact_start, circ.xact_finish, circ.target_copy, circ.circ_lib, circ.circ_staff, circ.checkin_staff,
                circ.checkin_lib, circ.renewal_remaining, circ.due_date, circ.stop_fines_time, circ.checkin_time, circ.create_time, circ.duration,